DiffMatching

Struct DiffMatching 

Source
pub struct DiffMatching { /* private fields */ }
Expand description

Tree matching algorithm optimized for diff generation.

This matching algorithm only uses exact content matches and prefers sequential matches to enable efficient run-length encoding in the generated diff output.

Implementations§

Source§

impl DiffMatching

Source

pub fn new() -> Self

Creates a new DiffMatching instance.

Source

pub fn branch_root_ref(&self) -> Option<&NodeRef>

Returns a reference to the branch root.

Trait Implementations§

Source§

impl Default for DiffMatching

Source§

fn default() -> DiffMatching

Returns the “default value” for a type. Read more
Source§

impl Matching for DiffMatching

Source§

fn build_matching(&mut self, base: &NodeRef, branch: &NodeRef)

Builds a matching between a base tree and a branch tree. Read more
Source§

fn get_area_stop_nodes(&self, stop_nodes: &mut Vec<NodeRef>, node: &NodeRef)

Gets the children of leaf nodes in a matching subtree. Read more
Source§

fn base_root(&self) -> Option<&NodeRef>

Returns a reference to the base tree root.
Source§

fn branch_root(&self) -> Option<&NodeRef>

Returns a reference to the branch tree root.

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> Same for T

Source§

type Output = T

Should always be Self
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.