Struct Const

Source
pub struct Const<R>(pub R);

Tuple Fields§

§0: R

Trait Implementations§

Source§

impl<R> Differ for Const<R>

Source§

fn begin_struct(self, _: &'static str) -> Self::StructDiffer

Begin traversing a struct.

Source§

type Ok = R

Type returned on success.
Source§

type Err = Void

Type returned on failure. Read more
Source§

type StructDiffer = Const<R>

The type we turn into when diffing a struct.
Source§

type StructVariantDiffer = Const<R>

The type we turn into when diffing a struct variant of an enum. Read more
Source§

type TupleDiffer = Const<R>

The type we turn into when diffing a tuple or tuple struct.
Source§

type TupleVariantDiffer = Const<R>

The type we turn into when diffing a tuple variant of an enum. Read more
Source§

type SeqDiffer = Const<R>

The type we turn into when diffing an abstract sequence.
Source§

type MapDiffer = Const<R>

The type we turn into when diffing an abstract map.
Source§

type SetDiffer = Const<R>

The type we turn into when diffing an abstract set.
Source§

fn difference(self, _: &dyn Debug, _: &dyn Debug) -> Result<Self::Ok, Self::Err>

Two atomic values have been discovered to be different, such as different numbers or different variants of an enum.
Source§

fn same(self, _: &dyn Debug, _: &dyn Debug) -> Result<Self::Ok, Self::Err>

Two atomic values are the same, such as equal numbers or identical unit variants of an enum.
Source§

fn diff_newtype<T>( self, _: &'static str, _: &T, _: &T, ) -> Result<Self::Ok, Self::Err>
where T: Diff + ?Sized,

Encounter a newtype. a and b are the contents of the sole fields of the left-hand and right-hand value, respectively.
Source§

fn begin_struct_variant( self, _: &'static str, _: &'static str, ) -> Self::StructVariantDiffer

Begin traversing a struct variant of an enum. Read more
Source§

fn begin_tuple(self, _: &'static str) -> Self::TupleDiffer

Begin traversing a tuple struct or raw tuple. Read more
Source§

fn begin_tuple_variant( self, _: &'static str, _: &'static str, ) -> Self::TupleVariantDiffer

Begin traversing a tuple variant of an enum. Read more
Source§

fn begin_seq(self) -> Self::SeqDiffer

Begin traversing a sequence. Read more
Source§

fn begin_map(self) -> Self::MapDiffer

Begin traversing a map.
Source§

fn begin_set(self) -> Self::SetDiffer

Begin traversing a set.
Source§

impl<R> MapDiffer for Const<R>

Source§

type Ok = R

Type returned on success.
Source§

type Err = Void

Type returned on failure.
Source§

fn diff_entry<K, V>(&mut self, _: &K, _: &V, _: &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, _: &K, _: &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, _: &K, _: &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.
Source§

impl<R> SeqDiffer for Const<R>

Source§

type Ok = R

Type returned on success.
Source§

type Err = Void

Type returned on failure.
Source§

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

We’ve found elements in corresponding positions in both sequences.
Source§

fn diff_elements<T, I>(&mut self, _: I, _: I)
where T: Diff, I: IntoIterator<Item = T>,

Consumes two iterators, diffing their contents. This is a convenience method implemented in terms of the others.
Source§

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

We’ve found an element that only appears in the left-hand sequence.
Source§

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

We’ve found an element that only appears in the right-hand sequence.
Source§

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

Complete the sequence and produce the result.
Source§

impl<R> SetDiffer for Const<R>

Source§

type Ok = R

Type returned on success.
Source§

type Err = Void

Type returned on failure.
Source§

fn diff_equal<V>(&mut self, _: &V, _: &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, _: &V)
where V: ?Sized + Diff,

Value a is only in the left-hand set.
Source§

fn only_in_right<V>(&mut self, _: &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.
Source§

impl<R> StructDiffer for Const<R>

Source§

type Ok = R

Type returned on success.
Source§

type Err = Void

Type returned on failure.
Source§

fn diff_field<T>(&mut self, _: &'static str, _: &T, _: &T)
where T: Diff + ?Sized,

Visits a field name with values a and b in the respective structures.
Source§

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

Completes traversal of the struct.
Source§

fn skip_field<T: ?Sized>(&mut self, _name: &'static str)

Skips a field that is excluded from differencing. Read more
Source§

impl<R> TupleDiffer for Const<R>

Source§

type Ok = R

Type returned on success.
Source§

type Err = Void

Type returned on failure.
Source§

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

Visits the next field in each tuple. The field number is implicit.
Source§

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

Finish diffing the tuples and return a result.
Source§

fn skip_field<T: ?Sized>(&mut self)

Signals that a field is being skipped. Some differs may do something with this information.

Auto Trait Implementations§

§

impl<R> Freeze for Const<R>
where R: Freeze,

§

impl<R> RefUnwindSafe for Const<R>
where R: RefUnwindSafe,

§

impl<R> Send for Const<R>
where R: Send,

§

impl<R> Sync for Const<R>
where R: Sync,

§

impl<R> Unpin for Const<R>
where R: Unpin,

§

impl<R> UnwindSafe for Const<R>
where R: UnwindSafe,

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

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

Source§

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.