pub struct PhantomContravariantLifetime<'a>(/* private fields */);
๐ฌThis is a nightly-only experimental API. (
phantom_variance_markers
)Expand description
Zero-sized type used to mark a lifetime as contravariant.
Contravariant lifetimes must live at most as long as declared. See the reference for more information.
Note: If 'a
is otherwise covariant or invariant, the resulting type is invariant.
ยงLayout
For all 'a
, the following are guaranteed:
size_of::<PhantomContravariantLifetime<'a>>() == 0
align_of::<PhantomContravariantLifetime<'a>>() == 1
Implementationsยง
Sourceยงimpl PhantomContravariantLifetime<'_>
impl PhantomContravariantLifetime<'_>
Sourcepub const fn new() -> PhantomContravariantLifetime<'_>
๐ฌThis is a nightly-only experimental API. (phantom_variance_markers
)
pub const fn new() -> PhantomContravariantLifetime<'_>
phantom_variance_markers
)Constructs a new instance of the variance marker.
Trait Implementationsยง
Sourceยงimpl<'a> Clone for PhantomContravariantLifetime<'a>
impl<'a> Clone for PhantomContravariantLifetime<'a>
Sourceยงfn clone(&self) -> PhantomContravariantLifetime<'a>
fn clone(&self) -> PhantomContravariantLifetime<'a>
Returns a duplicate of the value. Read more
1.0.0 ยท Sourceยงfn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSourceยงimpl Debug for PhantomContravariantLifetime<'_>
impl Debug for PhantomContravariantLifetime<'_>
Sourceยงimpl<'a> Default for PhantomContravariantLifetime<'a>
impl<'a> Default for PhantomContravariantLifetime<'a>
Sourceยงfn default() -> PhantomContravariantLifetime<'a>
fn default() -> PhantomContravariantLifetime<'a>
Returns the โdefault valueโ for a type. Read more
Sourceยงimpl<'a> Hash for PhantomContravariantLifetime<'a>
impl<'a> Hash for PhantomContravariantLifetime<'a>
Sourceยงimpl<'a> Ord for PhantomContravariantLifetime<'a>
impl<'a> Ord for PhantomContravariantLifetime<'a>
Sourceยงfn cmp(&self, other: &PhantomContravariantLifetime<'a>) -> Ordering
fn cmp(&self, other: &PhantomContravariantLifetime<'a>) -> Ordering
1.21.0 ยท Sourceยงfn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Sourceยงimpl<'a> PartialEq for PhantomContravariantLifetime<'a>
impl<'a> PartialEq for PhantomContravariantLifetime<'a>
Sourceยงfn eq(&self, other: &PhantomContravariantLifetime<'a>) -> bool
fn eq(&self, other: &PhantomContravariantLifetime<'a>) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.Sourceยงimpl<'a> PartialOrd for PhantomContravariantLifetime<'a>
impl<'a> PartialOrd for PhantomContravariantLifetime<'a>
impl<'a> Copy for PhantomContravariantLifetime<'a>
impl<'a> Eq for PhantomContravariantLifetime<'a>
impl<'a> StructuralPartialEq for PhantomContravariantLifetime<'a>
impl Variance for PhantomContravariantLifetime<'_>
Auto Trait Implementationsยง
impl<'a> Freeze for PhantomContravariantLifetime<'a>
impl<'a> RefUnwindSafe for PhantomContravariantLifetime<'a>
impl<'a> Send for PhantomContravariantLifetime<'a>
impl<'a> Sync for PhantomContravariantLifetime<'a>
impl<'a> Unpin for PhantomContravariantLifetime<'a>
impl<'a> UnwindSafe for PhantomContravariantLifetime<'a>
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Sourceยงimpl<T, U> ContextualTryInto<U> for Twhere
U: ContextualTryFrom<T>,
impl<T, U> ContextualTryInto<U> for Twhere
U: ContextualTryFrom<T>,
type Error = <U as ContextualTryFrom<T>>::Error
type Context = <U as ContextualTryFrom<T>>::Context
fn contextual_try_into( self, context: &<U as ContextualTryFrom<T>>::Context, ) -> Result<U, <U as ContextualTryFrom<T>>::Error>
Sourceยงimpl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Sourceยงfn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Sourceยงfn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Sourceยงfn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
โs vtable from &Trait
โs.Sourceยงfn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
โs vtable from &mut Trait
โs.Sourceยงimpl<T> DowncastSync for T
impl<T> DowncastSync for T
Sourceยงimpl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Sourceยงimpl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Sourceยงfn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Sourceยงimpl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Sourceยงfn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Sourceยงimpl<T> IntoEither for T
impl<T> IntoEither for T
Sourceยงfn into_either(self, into_left: bool) -> Either<Self, Self> โ
fn into_either(self, into_left: bool) -> Either<Self, Self> โ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSourceยงfn into_either_with<F>(self, into_left: F) -> Either<Self, Self> โ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> โ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more