pub struct Identity<A>(pub A);
Expand description
A simple wrapper struct that holds a value of type A
.
This is the core data type for the Identity
monad. It doesn’t add
any special context other than simply containing the value.
Tuple Fields§
§0: A
Trait Implementations§
Source§impl<A: Ord> Ord for Identity<A>
impl<A: Ord> Ord for Identity<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: PartialOrd> PartialOrd for Identity<A>
impl<A: PartialOrd> PartialOrd for Identity<A>
impl<A: Eq> Eq for Identity<A>
impl<A> StructuralPartialEq for Identity<A>
Auto Trait Implementations§
impl<A> Freeze for Identity<A>where
A: Freeze,
impl<A> RefUnwindSafe for Identity<A>where
A: RefUnwindSafe,
impl<A> Send for Identity<A>where
A: Send,
impl<A> Sync for Identity<A>where
A: Sync,
impl<A> Unpin for Identity<A>where
A: Unpin,
impl<A> UnwindSafe for Identity<A>where
A: UnwindSafe,
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