[][src]Struct type_variance::Lifetime

pub struct Lifetime<'a> { /* fields omitted */ }

Variance-preserving type wrapper around a lifetime parameter.

This can be useful to indicate the variance of a generic type with respect to a lifetime parameter, rather than a type parameter.

For example:

use type_variance::{Covariant, Lifetime};

struct Guard<'a> {
    marker: Covariant<Lifetime<'a>>,
}

This marks Guard as being covariant to 'a.

Note that this type is not constructible, and so should be wrapped with either a PhantomData or one of the variance marker types.

Trait Implementations

impl<'a> Clone for Lifetime<'a>[src]

impl<'a> Copy for Lifetime<'a>[src]

impl<'a> Debug for Lifetime<'a>[src]

impl<'a> Eq for Lifetime<'a>[src]

impl<'a> Hash for Lifetime<'a>[src]

impl<'a> Ord for Lifetime<'a>[src]

impl<'a> PartialEq<Lifetime<'a>> for Lifetime<'a>[src]

impl<'a> PartialOrd<Lifetime<'a>> for Lifetime<'a>[src]

impl<'a> StructuralEq for Lifetime<'a>[src]

impl<'a> StructuralPartialEq for Lifetime<'a>[src]

Auto Trait Implementations

impl<'a> Send for Lifetime<'a>

impl<'a> Sync for Lifetime<'a>

impl<'a> Unpin for Lifetime<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.