Trait treediff::Delegate [] [src]

pub trait Delegate<'a, K, V> {
    fn push<'b>(&mut self, _k: &'b K) { ... }
    fn pop(&mut self) { ... }
    fn removed<'b>(&mut self, _k: &'b K, _v: &'a V) { ... }
    fn added<'b>(&mut self, _k: &'b K, _v: &'a V) { ... }
    fn unchanged<'b>(&mut self, _v: &'a V) { ... }
    fn modified<'b>(&mut self, _old: &'a V, _new: &'a V) { ... }
}

The delegate receiving callbacks by the diff algorithm, which compares an old to a new value.

Type Parameters

  • K is the Key's type
  • V is the Value's type

Methods will be called if...

Provided Methods

... we recurse into the Value at the given Key.

Delegates should memoize the current Key path to be able to compute the full Key path when needed.

... we have processed all items and leave the object previously pushed.

... the Value v at the given Key k should be removed.

Note that the Key is partial, and should be used in conjunction with the recorded Keys received via push(...)

.. the Value v at the given Key k should be added.

Note that the Key is partial, and should be used in conjunction with the recorded Keys received via push(...)

The Value v was not changed.

... the old Value was modified, and is now the new Value.

Implementors