Trait SetDiffer

Source
pub trait SetDiffer {
    type Ok;
    type Err;

    // Required methods
    fn diff_equal<V>(&mut self, a: &V, b: &V)
       where V: ?Sized + Diff;
    fn only_in_left<V>(&mut self, a: &V)
       where V: ?Sized + Diff;
    fn only_in_right<V>(&mut self, b: &V)
       where 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 set-like sequence type, i.e. one in which elements are expected to be unique.

Required Associated Types§

Source

type Ok

Type returned on success.

Source

type Err

Type returned on failure.

Required Methods§

Source

fn diff_equal<V>(&mut self, a: &V, b: &V)
where V: ?Sized + Diff,

The sets contain a and b which compare as equal. Check them for differences.

Source

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

Value a is only in the left-hand set.

Source

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

Value b is only in the right-hand set.

Source

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

We’ve reached the end of the sets.

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 SetDiffer for ()

Source§

type Ok = ()

Source§

type Err = Void

Source§

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

Source§

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

Source§

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

Source§

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

Implementors§

Source§

impl<R> SetDiffer for Const<R>

Source§

type Ok = R

Source§

type Err = Void