pub struct PhantomContravariant<T>(/* private fields */)
where
T: ?Sized;
Expand description
Zero-sized type used to mark a type parameter as contravariant.
Types passed as arguments to a function are contravariant. If the type is also part of the return value from a function then it is invariant. See the reference for more information.
§Layout
For all T
, the following are guaranteed:
size_of::<PhantomContravariant<T>>() == 0
align_of::<PhantomContravariant<T>>() == 1
Implementations§
Trait Implementations§
Source§impl<T> Clone for PhantomContravariant<T>where
T: ?Sized,
impl<T> Clone for PhantomContravariant<T>where
T: ?Sized,
Source§impl<T> Debug for PhantomContravariant<T>where
T: ?Sized,
impl<T> Debug for PhantomContravariant<T>where
T: ?Sized,
Source§impl<T> Default for PhantomContravariant<T>where
T: ?Sized,
impl<T> Default for PhantomContravariant<T>where
T: ?Sized,
Source§impl<T> Hash for PhantomContravariant<T>where
T: ?Sized,
impl<T> Hash for PhantomContravariant<T>where
T: ?Sized,
Source§impl<T> Ord for PhantomContravariant<T>where
T: ?Sized,
impl<T> Ord for PhantomContravariant<T>where
T: ?Sized,
Source§impl<T> PartialEq for PhantomContravariant<T>where
T: ?Sized,
impl<T> PartialEq for PhantomContravariant<T>where
T: ?Sized,
Source§impl<T> PartialOrd for PhantomContravariant<T>where
T: ?Sized,
impl<T> PartialOrd for PhantomContravariant<T>where
T: ?Sized,
impl<T> Copy for PhantomContravariant<T>where
T: ?Sized,
impl<T> Eq for PhantomContravariant<T>where
T: ?Sized,
impl<T> Variance for PhantomContravariant<T>where
T: ?Sized,
Auto Trait Implementations§
impl<T> Freeze for PhantomContravariant<T>where
T: ?Sized,
impl<T> RefUnwindSafe for PhantomContravariant<T>where
T: ?Sized,
impl<T> Send for PhantomContravariant<T>where
T: ?Sized,
impl<T> Sync for PhantomContravariant<T>where
T: ?Sized,
impl<T> Unpin for PhantomContravariant<T>where
T: ?Sized,
impl<T> UnwindSafe for PhantomContravariant<T>where
T: ?Sized,
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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