Struct PhantomInvariant

struct PhantomInvariant<T>(_)
where
    T: ?Sized

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:

Implementations

impl<T> PhantomInvariant<T>

const fn new() -> Self

Constructs a new instance of the variance marker.

impl<T> Any for PhantomInvariant<T>

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for PhantomInvariant<T>

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for PhantomInvariant<T>

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> Clone for PhantomInvariant<T>

fn clone(self: &Self) -> Self

impl<T> CloneToUninit for PhantomInvariant<T>

unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)

impl<T> Copy for PhantomInvariant<T>

impl<T> Debug for PhantomInvariant<T>

fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result

impl<T> Default for PhantomInvariant<T>

fn default() -> Self

impl<T> Eq for PhantomInvariant<T>

impl<T> Freeze for PhantomInvariant<T>

impl<T> From for PhantomInvariant<T>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Hash for PhantomInvariant<T>

fn hash<H: Hasher>(self: &Self, _: &mut H)

impl<T> Ord for PhantomInvariant<T>

fn cmp(self: &Self, _: &Self) -> Ordering

impl<T> PartialEq for PhantomInvariant<T>

fn eq(self: &Self, _: &Self) -> bool

impl<T> PartialOrd for PhantomInvariant<T>

fn partial_cmp(self: &Self, _: &Self) -> Option<Ordering>

impl<T> RefUnwindSafe for PhantomInvariant<T>

impl<T> Send for PhantomInvariant<T>

impl<T> Sync for PhantomInvariant<T>

impl<T> Unpin for PhantomInvariant<T>

impl<T> UnsafeUnpin for PhantomInvariant<T>

impl<T> UnwindSafe for PhantomInvariant<T>

impl<T> Variance for PhantomInvariant<T>

impl<T, U> Into for PhantomInvariant<T>

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for PhantomInvariant<T>

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for PhantomInvariant<T>

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>