Skip to main content

DiffNode

Struct DiffNode 

Source
pub struct DiffNode {
Show 13 fields pub action: String, pub item_type: String, pub path: String, pub source_path: Option<String>, pub summary: Option<String>, pub tags: BTreeSet<String>, pub children: Vec<DiffNode>, pub details: BTreeMap<String, Value>, pub annotations: BTreeMap<String, Value>, pub comparator: Option<String>, pub transformed_by: Vec<String>, pub source_items: Option<ItemPair>, pub artifacts: Vec<ArtifactDescriptor>,
}
Expand description

A node in the diff tree — the central data structure of the system. Every comparator emits it, every transformer rewrites it, and serializers or bindings read it.

Fields§

§action: String

Open enum: “add”, “remove”, “modify”, “move”, “reorder”, “schema_change”, etc. Plugins may define new actions.

§item_type: String

Open string: “directory”, “file”, “tabular”, “zip_archive”, etc. No built-in types — conventions, not enforcement.

§path: String

Location within snapshot (logical path, including interior paths like “archive.zip/data/file.csv”).

§source_path: Option<String>

For moves/renames: the original path.

§summary: Option<String>

Optional human-readable one-liner describing the change. Set by comparator or transformer; used by renderers for narrative rendering.

§tags: BTreeSet<String>

Open bag of semantic tags, namespaced by convention. e.g. “binoc.column-reorder”, “biobinoc.gap-change”

§children: Vec<DiffNode>

Child diff nodes forming the tree structure.

§details: BTreeMap<String, Value>

Comparator-specific payload, schema determined by item_type convention.

§annotations: BTreeMap<String, Value>

Transformer-added metadata.

§comparator: Option<String>

Which comparator produced this node (provenance for extract chain).

§transformed_by: Vec<String>

Transformers that modified this node, in order (provenance for extract chain).

§source_items: Option<ItemPair>

The original item pair that produced this node. Session-scoped working data: available during a live diff/transform session for transformers and extractors that need to re-read source data, and carried across the plugin ABI wire so separately-compiled plugins can access it. Callers writing changeset output must strip this via DiffNode::strip_transient before serializing.

§artifacts: Vec<ArtifactDescriptor>

Published artifacts for this node. Session-scoped working data: carried across the plugin ABI wire as descriptors (the bytes live in the shared data_root cache), but not meaningful outside a session. Callers writing changeset output must strip this via DiffNode::strip_transient before serializing.

Implementations§

Source§

impl DiffNode

Source

pub fn new( action: impl Into<String>, item_type: impl Into<String>, path: impl Into<String>, ) -> Self

Source

pub fn with_summary(self, summary: impl Into<String>) -> Self

Source

pub fn with_tag(self, tag: impl Into<String>) -> Self

Source

pub fn with_detail(self, key: impl Into<String>, value: Value) -> Self

Source

pub fn with_children(self, children: Vec<DiffNode>) -> Self

Source

pub fn with_source_path(self, source: impl Into<String>) -> Self

Source

pub fn with_source_items(self, items: ItemPair) -> Self

Source

pub fn with_artifact(self, artifact: ArtifactDescriptor) -> Self

Source

pub fn node_count(&self) -> usize

Source

pub fn all_tags(&self) -> BTreeSet<String>

Source

pub fn strip_transient(&mut self)

Recursively clear session-scoped transient fields (source_items, artifacts) on this node and all descendants.

These fields are wire-visible so the plugin ABI can move them across process-ready boundaries, but they are not meaningful outside a live session and must be stripped before writing changeset output intended for users (JSON files, renderer output, Python return values).

Trait Implementations§

Source§

impl Clone for DiffNode

Source§

fn clone(&self) -> DiffNode

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DiffNode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for DiffNode

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for DiffNode

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,