pub struct PhantomInvariant<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 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:
size_of::<PhantomInvariant<T>>() == 0align_of::<PhantomInvariant<T>>() == 1
Implementationsยง
Trait Implementationsยง
Sourceยงimpl<T> Clone for PhantomInvariant<T>where
T: ?Sized,
impl<T> Clone for PhantomInvariant<T>where
T: ?Sized,
Sourceยงfn clone(&self) -> Self
fn clone(&self) -> Self
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
Returns a duplicate of the value. Read more
1.0.0 ยท Sourceยงfn clone_from(&mut self, source: &Self)where
Self:,
fn clone_from(&mut self, source: &Self)where
Self:,
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
Performs copy-assignment from
source. Read moreSourceยงimpl<T> Debug for PhantomInvariant<T>where
T: ?Sized,
impl<T> Debug for PhantomInvariant<T>where
T: ?Sized,
Sourceยงimpl<T> Default for PhantomInvariant<T>where
T: ?Sized,
impl<T> Default for PhantomInvariant<T>where
T: ?Sized,
Sourceยงimpl<T> Hash for PhantomInvariant<T>where
T: ?Sized,
impl<T> Hash for PhantomInvariant<T>where
T: ?Sized,
Sourceยงimpl<T> Ord for PhantomInvariant<T>where
T: ?Sized,
impl<T> Ord for PhantomInvariant<T>where
T: ?Sized,
Sourceยงfn cmp(&self, _: &Self) -> Ordering
fn cmp(&self, _: &Self) -> Ordering
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
1.21.0 ยท Sourceยงfn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
Compares and returns the maximum of two values. Read more
Sourceยงimpl<T> PartialEq for PhantomInvariant<T>where
T: ?Sized,
impl<T> PartialEq for PhantomInvariant<T>where
T: ?Sized,
Sourceยงimpl<T> PartialOrd for PhantomInvariant<T>where
T: ?Sized,
impl<T> PartialOrd for PhantomInvariant<T>where
T: ?Sized,
Sourceยงfn partial_cmp(&self, _: &Self) -> Option<Ordering>
fn partial_cmp(&self, _: &Self) -> Option<Ordering>
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
1.0.0 ยท Sourceยงfn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
1.0.0 ยท Sourceยงfn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
impl<T> Copy for PhantomInvariant<T>where
T: ?Sized,
impl<T> Eq for PhantomInvariant<T>where
T: ?Sized,
impl<T> Variance for PhantomInvariant<T>where
T: ?Sized,
Auto Trait Implementationsยง
impl<T> Freeze for PhantomInvariant<T>where
T: ?Sized,
impl<T> RefUnwindSafe for PhantomInvariant<T>where
T: ?Sized,
impl<T> Send for PhantomInvariant<T>where
T: ?Sized,
impl<T> Sync for PhantomInvariant<T>where
T: ?Sized,
impl<T> Unpin for PhantomInvariant<T>where
T: ?Sized,
impl<T> UnsafeUnpin for PhantomInvariant<T>where
T: ?Sized,
impl<T> UnwindSafe for PhantomInvariant<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
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
Mutably borrows from an owned value. Read more