Struct PhantomCovariant
struct PhantomCovariant<T>(_)
where
T: ?Sized
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][PhantomInvariant]. See the reference for more information.
Note: If T is otherwise contravariant or invariant, the resulting type is invariant.
Layout
For all T, the following are guaranteed:
size_of::<PhantomCovariant<T>>() == 0align_of::<PhantomCovariant<T>>() == 1
Implementations
impl<T> PhantomCovariant<T>
const fn new() -> SelfConstructs a new instance of the variance marker.
impl<T> Any for PhantomCovariant<T>
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for PhantomCovariant<T>
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for PhantomCovariant<T>
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> Clone for PhantomCovariant<T>
fn clone(self: &Self) -> Self
impl<T> CloneToUninit for PhantomCovariant<T>
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> Copy for PhantomCovariant<T>
impl<T> Debug for PhantomCovariant<T>
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl<T> Default for PhantomCovariant<T>
fn default() -> Self
impl<T> Eq for PhantomCovariant<T>
impl<T> Freeze for PhantomCovariant<T>
impl<T> From for PhantomCovariant<T>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> Hash for PhantomCovariant<T>
fn hash<H: Hasher>(self: &Self, _: &mut H)
impl<T> Ord for PhantomCovariant<T>
fn cmp(self: &Self, _: &Self) -> Ordering
impl<T> PartialEq for PhantomCovariant<T>
fn eq(self: &Self, _: &Self) -> bool
impl<T> PartialOrd for PhantomCovariant<T>
fn partial_cmp(self: &Self, _: &Self) -> Option<Ordering>
impl<T> RefUnwindSafe for PhantomCovariant<T>
impl<T> Send for PhantomCovariant<T>
impl<T> Sync for PhantomCovariant<T>
impl<T> Unpin for PhantomCovariant<T>
impl<T> UnsafeUnpin for PhantomCovariant<T>
impl<T> UnwindSafe for PhantomCovariant<T>
impl<T> Variance for PhantomCovariant<T>
impl<T, U> Into for PhantomCovariant<T>
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for PhantomCovariant<T>
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for PhantomCovariant<T>
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>