Struct treediff::tools::Recorder

source ·
pub struct Recorder<'a, K, V: 'a> {
    pub calls: Vec<ChangeType<'a, K, V>>,
    /* private fields */
}
Expand description

A Delegate to record all calls made to it.

It can be useful if you don’t want to implement your own custom delegate, but instead just want to quickly see a flat list of all results of the diff run.

§Examples

Please see the tests for how to use this type.

Fields§

§calls: Vec<ChangeType<'a, K, V>>

A list of all calls the diff function made on us.

Trait Implementations§

source§

impl<'a, K: Debug, V: Debug + 'a> Debug for Recorder<'a, K, V>

source§

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

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

impl<'a, K, V> Default for Recorder<'a, K, V>

source§

fn default() -> Self

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

impl<'a, K, V> Delegate<'a, K, V> for Recorder<'a, K, V>
where K: Clone,

source§

fn push(&mut self, k: &K)

… we recurse into the Value at the given Key. Read more
source§

fn pop(&mut self)

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

fn removed<'b>(&mut self, k: &'b K, v: &'a V)

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

fn added<'b>(&mut self, k: &'b K, v: &'a V)

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

fn unchanged<'b>(&mut self, v: &'a V)

The Value v was not changed.
source§

fn modified<'b>(&mut self, v1: &'a V, v2: &'a V)

… the old Value was modified, and is now the new Value.
source§

impl<'a, K: PartialEq, V: PartialEq + 'a> PartialEq for Recorder<'a, K, V>

source§

fn eq(&self, other: &Recorder<'a, K, V>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a, K, V: 'a> StructuralPartialEq for Recorder<'a, K, V>

Auto Trait Implementations§

§

impl<'a, K, V> Freeze for Recorder<'a, K, V>

§

impl<'a, K, V> RefUnwindSafe for Recorder<'a, K, V>

§

impl<'a, K, V> Send for Recorder<'a, K, V>
where K: Send, V: Sync,

§

impl<'a, K, V> Sync for Recorder<'a, K, V>
where K: Sync, V: Sync,

§

impl<'a, K, V> Unpin for Recorder<'a, K, V>
where K: Unpin,

§

impl<'a, K, V> UnwindSafe for Recorder<'a, K, V>

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

§

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

§

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.