pub struct PhantomInvariant<T>(/* private fields */)
where
T: ?Sized;
Expand description
Zero-sized type used to mark a type parameter as invariant.
Types that are both passed as an argument and used as part of the return value from a function are invariant. See the reference for more information.
§Layout
For all T
, the following are guaranteed:
size_of::<PhantomInvariant<T>>() == 0
align_of::<PhantomInvariant<T>>() == 1
Implementations§
Trait Implementations§
Source§impl<T> Clone for PhantomInvariant<T>where
T: ?Sized,
impl<T> Clone for PhantomInvariant<T>where
T: ?Sized,
Source§impl<T> Debug for PhantomInvariant<T>where
T: ?Sized,
impl<T> Debug for PhantomInvariant<T>where
T: ?Sized,
Source§impl<T> Default for PhantomInvariant<T>where
T: ?Sized,
impl<T> Default for PhantomInvariant<T>where
T: ?Sized,
Source§impl<T> Hash for PhantomInvariant<T>where
T: ?Sized,
impl<T> Hash for PhantomInvariant<T>where
T: ?Sized,
Source§impl<T> Ord for PhantomInvariant<T>where
T: ?Sized,
impl<T> Ord for PhantomInvariant<T>where
T: ?Sized,
Source§impl<T> PartialEq for PhantomInvariant<T>where
T: ?Sized,
impl<T> PartialEq for PhantomInvariant<T>where
T: ?Sized,
Source§impl<T> PartialOrd for PhantomInvariant<T>where
T: ?Sized,
impl<T> PartialOrd for PhantomInvariant<T>where
T: ?Sized,
impl<T> Copy for PhantomInvariant<T>where
T: ?Sized,
impl<T> Eq for PhantomInvariant<T>where
T: ?Sized,
impl<T> Variance for PhantomInvariant<T>where
T: ?Sized,
Auto Trait Implementations§
impl<T> Freeze for PhantomInvariant<T>where
T: ?Sized,
impl<T> RefUnwindSafe for PhantomInvariant<T>where
T: ?Sized,
impl<T> Send for PhantomInvariant<T>where
T: ?Sized,
impl<T> Sync for PhantomInvariant<T>where
T: ?Sized,
impl<T> Unpin for PhantomInvariant<T>where
T: ?Sized,
impl<T> UnwindSafe for PhantomInvariant<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