Struct treediff::tools::Merger [] [src]

pub struct Merger<K, V, BF, F> { /* fields omitted */ }

A Delegate which applies differences to a target object.

It wraps the target object and applies all calls by the diff algorithm to it, which changes it in some way.

Custom resolver functions can be provided to arbitrarily alter the way the merge is performed. This allows you, for example, to keep your own meta-data, or to implement custom conflict resolutions.

Examples

Please see the tests for usage examples.

Methods

impl<K, V, BF, F> Merger<K, V, BF, F>
[src]

Consume the merger and return the contained target Value, which is the result of the merge operation.

Returns a mutable borrow to the MutableFilter instance

Returns a borrow to the MutableFilter instance

impl<'a, V, BF, F> Merger<V::Key, V, BF, F> where V: Mutable + 'a + Clone,
        F: MutableFilter,
        BF: BorrowMut<F>
[src]

Return a new Merger with the given initial value v and the filter f

Trait Implementations

impl<'a, K, V, F, BF> Delegate<'a, K, V> for Merger<K, V, BF, F> where V: Mutable<Key=K, Item=V> + Clone + 'a,
        K: Clone + Display,
        F: MutableFilter,
        BF: BorrowMut<F>
[src]

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

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

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

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

The Value v was not changed.

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

impl<K, V, BF, F> AsRef<V> for Merger<K, V, BF, F>
[src]

Performs the conversion.

impl<'a, V> From<V> for Merger<V::Key, V, DefaultMutableFilter, DefaultMutableFilter> where V: Mutable + 'a + Clone
[src]

Return a new merger with the given initial value v, and the DefaultMutableFilter.