#[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.
Note: If T is otherwise covariant or invariant, the resulting type is invariant.
§Layout
For all T, the following are guaranteed:
size_of::<PhantomContravariant<T>>() == 0align_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,
1.0.0 · Source§#[doc(hidden)]fn assert_receiver_is_total_eq(&self)
#[doc(hidden)]fn assert_receiver_is_total_eq(&self)
👎Deprecated since 1.95.0: implementation detail of
#[derive(Eq)]Source§#[doc(hidden)]fn assert_fields_are_eq(&self)
#[doc(hidden)]fn assert_fields_are_eq(&self)
🔬This is a nightly-only experimental API. (
derive_eq_internals)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> TrivialClone 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 SIZE: usize = _
#[doc(hidden)]const SIZE: usize = _
🔬This is a nightly-only experimental API. (
sized_type_properties)Source§#[doc(hidden)]const ALIGN: usize = _
#[doc(hidden)]const ALIGN: usize = _
🔬This is a nightly-only experimental API. (
sized_type_properties)Source§#[doc(hidden)]const ALIGNMENT: Alignment = _
#[doc(hidden)]const ALIGNMENT: Alignment = _
🔬This is a nightly-only experimental API. (
ptr_alignment_type #102070)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