Skip to main content

DiffNode

Enum DiffNode 

Source
pub enum DiffNode {
    Container {
        segment: PathSegment,
        child_kind: ChildKind,
        omitted_count: u16,
        children: Vec<DiffNode>,
    },
    Leaf {
        segment: PathSegment,
        kind: DiffKind,
    },
}
Expand description

A node in the diff tree.

Variants§

§

Container

An intermediate node containing child diffs.

Fields

§segment: PathSegment

The path segment for this container.

§child_kind: ChildKind

Whether the children are object fields or array items.

§omitted_count: u16

Number of siblings/elements in the actual data not shown in the diff.

§children: Vec<DiffNode>

Child diff nodes.

§

Leaf

A terminal node representing a single difference.

Fields

§segment: PathSegment

The path segment for this leaf.

§kind: DiffKind

The kind of difference.

Implementations§

Source§

impl DiffNode

Source

pub fn leaf(segment: PathSegment, kind: DiffKind) -> Self

Creates a leaf node representing a single difference.

Source

pub fn container( segment: PathSegment, child_kind: ChildKind, omitted_count: u16, children: Vec<DiffNode>, ) -> Self

Creates a container node with child diffs.

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> 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, 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.