pub struct PhantomCovariant<T>(/* private fields */)
where
T: ?Sized;
🔬This is a nightly-only experimental API. (
phantom_variance_markers
#135806)Expand description
Zero-sized type used to mark a type parameter as covariant.
Types used as part of the return value from a function are covariant. If the type is also passed as a parameter then it is invariant. See the reference for more information.
§Layout
For all T
, the following are guaranteed:
size_of::<PhantomCovariant<T>>() == 0
align_of::<PhantomCovariant<T>>() == 1
Implementations§
Trait Implementations§
Source§impl<T> Clone for PhantomCovariant<T>where
T: ?Sized,
impl<T> Clone for PhantomCovariant<T>where
T: ?Sized,
Source§impl<T> Debug for PhantomCovariant<T>where
T: ?Sized,
impl<T> Debug for PhantomCovariant<T>where
T: ?Sized,
Source§impl<T> Default for PhantomCovariant<T>where
T: ?Sized,
impl<T> Default for PhantomCovariant<T>where
T: ?Sized,
Source§impl<T> Hash for PhantomCovariant<T>where
T: ?Sized,
impl<T> Hash for PhantomCovariant<T>where
T: ?Sized,
Source§impl<T> Ord for PhantomCovariant<T>where
T: ?Sized,
impl<T> Ord for PhantomCovariant<T>where
T: ?Sized,
Source§impl<T> PartialEq for PhantomCovariant<T>where
T: ?Sized,
impl<T> PartialEq for PhantomCovariant<T>where
T: ?Sized,
Source§impl<T> PartialOrd for PhantomCovariant<T>where
T: ?Sized,
impl<T> PartialOrd for PhantomCovariant<T>where
T: ?Sized,
impl<T> Copy for PhantomCovariant<T>where
T: ?Sized,
impl<T> Eq for PhantomCovariant<T>where
T: ?Sized,
impl<T> Variance for PhantomCovariant<T>where
T: ?Sized,
Auto Trait Implementations§
impl<T> Freeze for PhantomCovariant<T>where
T: ?Sized,
impl<T> RefUnwindSafe for PhantomCovariant<T>where
T: ?Sized,
impl<T> Send for PhantomCovariant<T>where
T: ?Sized,
impl<T> Sync for PhantomCovariant<T>where
T: ?Sized,
impl<T> Unpin for PhantomCovariant<T>where
T: ?Sized,
impl<T> UnwindSafe for PhantomCovariant<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