Trait MapDiffer

Source
pub trait MapDiffer {
    type Ok;
    type Err;

    // Required methods
    fn diff_entry<K, V>(&mut self, key: &K, a: &V, b: &V)
       where K: ?Sized + Debug,
             V: ?Sized + Diff;
    fn only_in_left<K, V>(&mut self, key: &K, a: &V)
       where K: ?Sized + Debug,
             V: ?Sized + Diff;
    fn only_in_right<K, V>(&mut self, key: &K, b: &V)
       where K: ?Sized + Debug,
             V: ?Sized + Diff;
    fn end(self) -> Result<Self::Ok, Self::Err>;
}
Expand description

A type that can do something with information about differences in a map-like, key-value type.

Required Associated Types§

Source

type Ok

Type returned on success.

Source

type Err

Type returned on failure.

Required Methods§

Source

fn diff_entry<K, V>(&mut self, key: &K, a: &V, b: &V)
where K: ?Sized + Debug, V: ?Sized + Diff,

Both maps contain entries for key; check them for differences.

Source

fn only_in_left<K, V>(&mut self, key: &K, a: &V)
where K: ?Sized + Debug, V: ?Sized + Diff,

Key key is only present in the left map, with value a.

Source

fn only_in_right<K, V>(&mut self, key: &K, b: &V)
where K: ?Sized + Debug, V: ?Sized + Diff,

Key key is only present in the right map, with value b.

Source

fn end(self) -> Result<Self::Ok, Self::Err>

We’ve reached the end of the maps.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl MapDiffer for ()

Source§

type Ok = ()

Source§

type Err = Void

Source§

fn diff_entry<K, V>(&mut self, _: &K, _: &V, _: &V)
where K: ?Sized + Debug, V: ?Sized + Diff,

Source§

fn only_in_left<K, V>(&mut self, _: &K, _: &V)
where K: ?Sized + Debug, V: ?Sized + Diff,

Source§

fn only_in_right<K, V>(&mut self, _: &K, _: &V)
where K: ?Sized + Debug, V: ?Sized + Diff,

Source§

fn end(self) -> Result<Self::Ok, Self::Err>

Implementors§

Source§

impl<R> MapDiffer for Const<R>

Source§

type Ok = R

Source§

type Err = Void