Struct core::kinds::marker::ContravariantLifetime[src]

pub struct ContravariantLifetime<'a>;

As ContravariantType, but for lifetime parameters. Using ContravariantLifetime<'a> indicates that it is ok to substitute a shorter lifetime for 'a than the one you originally started with (e.g., you could convert 'static to any lifetime 'foo). This is appropriate for cases where you have an unsafe pointer that is actually a pointer into some memory with lifetime 'a, and thus you want to limit the lifetime of your data structure to 'a. An example of where this is used is the iterator for vectors.

For more information about variance, refer to this Wikipedia article http://en.wikipedia.org/wiki/Variance_%28computer_science%29.

Trait Implementations

Derived Implementations

impl<'a> Clone for ContravariantLifetime<'a>

fn clone(&self) -> ContravariantLifetime<'a>

fn clone_from(&mut self, source: &Self)

impl<'a> PartialEq for ContravariantLifetime<'a>

fn eq(&self, __arg_0: &ContravariantLifetime<'a>) -> bool

fn ne(&self, __arg_0: &ContravariantLifetime<'a>) -> bool