#[repr(transparent)]pub struct PhantomContravariant<T>(PhantomData<fn(T)>)
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 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
Tuple Fieldsยง
ยง0: PhantomData<fn(T)>
๐ฌThis is a nightly-only experimental API. (
phantom_variance_markers
#135806)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> Eq for PhantomContravariant<T>where
T: ?Sized,
impl<T> Eq for PhantomContravariant<T>where
T: ?Sized,
#[doc(hidden)] fn assert_receiver_is_total_eq(&self)
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,
Sourceยงfn partial_cmp(&self, _: &Self) -> Option<Ordering>
fn partial_cmp(&self, _: &Self) -> Option<Ordering>
Sourceยง#[doc(hidden)] fn __chaining_lt(&self, other: &Rhs) -> ControlFlow<bool>
#[doc(hidden)] fn __chaining_lt(&self, other: &Rhs) -> ControlFlow<bool>
๐ฌThis is a nightly-only experimental API. (
partial_ord_chaining_methods
)If
self == other
, returns ControlFlow::Continue(())
.
Otherwise, returns ControlFlow::Break(self < other)
. Read moreSourceยง#[doc(hidden)] fn __chaining_le(&self, other: &Rhs) -> ControlFlow<bool>
#[doc(hidden)] fn __chaining_le(&self, other: &Rhs) -> ControlFlow<bool>
๐ฌThis is a nightly-only experimental API. (
partial_ord_chaining_methods
)Same as
__chaining_lt
, but for <=
instead of <
.Sourceยง#[doc(hidden)] fn __chaining_gt(&self, other: &Rhs) -> ControlFlow<bool>
#[doc(hidden)] fn __chaining_gt(&self, other: &Rhs) -> ControlFlow<bool>
๐ฌThis is a nightly-only experimental API. (
partial_ord_chaining_methods
)Same as
__chaining_lt
, but for >
instead of <
.Sourceยง#[doc(hidden)] fn __chaining_ge(&self, other: &Rhs) -> ControlFlow<bool>
#[doc(hidden)] fn __chaining_ge(&self, other: &Rhs) -> ControlFlow<bool>
๐ฌThis is a nightly-only experimental API. (
partial_ord_chaining_methods
)Same as
__chaining_lt
, but for >=
instead of <
.Sourceยงimpl<T> Sealed for PhantomContravariant<T>where
T: ?Sized,
impl<T> Sealed for PhantomContravariant<T>where
T: ?Sized,
impl<T> Copy 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> UnsafeUnpin 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,
Sourceยงimpl<T> SizedTypeProperties for T
impl<T> SizedTypeProperties for T
Sourceยง#[doc(hidden)] const IS_ZST: bool = _
#[doc(hidden)] const IS_ZST: bool = _
๐ฌThis is a nightly-only experimental API. (
sized_type_properties
)Sourceยง#[doc(hidden)] const LAYOUT: Layout = _
#[doc(hidden)] const LAYOUT: Layout = _
๐ฌThis is a nightly-only experimental API. (
sized_type_properties
)Sourceยง#[doc(hidden)] const MAX_SLICE_LEN: usize = _
#[doc(hidden)] const MAX_SLICE_LEN: usize = _
๐ฌThis is a nightly-only experimental API. (
sized_type_properties
)The largest safe length for a
[Self]
. Read more