pub struct Const<'a, R, A>(pub R, pub PhantomData<&'a A>);Expand description
The Const functor.
Const<R, A> stores a value of type R and ignores the type A.
§Type Parameters
'a: The lifetime of the values.R: The stored type.A: The ignored type.
Tuple Fields§
§0: R§1: PhantomData<&'a A>Implementations§
Trait Implementations§
Source§impl<'a, R: Ord, A: Ord> Ord for Const<'a, R, A>
impl<'a, R: Ord, A: Ord> Ord for Const<'a, R, A>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<'a, R: PartialOrd, A: PartialOrd> PartialOrd for Const<'a, R, A>
impl<'a, R: PartialOrd, A: PartialOrd> PartialOrd for Const<'a, R, A>
impl<'a, R: Copy, A> Copy for Const<'a, R, A>
impl<'a, R: Eq, A: Eq> Eq for Const<'a, R, A>
impl<'a, R, A> StructuralPartialEq for Const<'a, R, A>
Auto Trait Implementations§
impl<'a, R, A> Freeze for Const<'a, R, A>where
R: Freeze,
impl<'a, R, A> RefUnwindSafe for Const<'a, R, A>where
R: RefUnwindSafe,
A: RefUnwindSafe,
impl<'a, R, A> Send for Const<'a, R, A>
impl<'a, R, A> Sync for Const<'a, R, A>
impl<'a, R, A> Unpin for Const<'a, R, A>where
R: Unpin,
impl<'a, R, A> UnsafeUnpin for Const<'a, R, A>where
R: UnsafeUnpin,
impl<'a, R, A> UnwindSafe for Const<'a, R, A>where
R: UnwindSafe,
A: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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