Struct transient::Contra

source ·
pub struct Contra<'a>(/* private fields */);
Expand description

Used to declare an contravariant relationship between a type and its lifetime parameter.

A contravariant type is one for which the compiler can safely lengthen its lifetime parameter as needed when passing it to a function; for example, fn(&'a str) is contravariant w.r.t. 'a, so fn(&'short str) can be used where fn(&'static str) is expected.

See the Transience documentation for more information.

Trait Implementations§

source§

impl<'a> Clone for Contra<'a>

source§

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

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl<'a> Debug for Contra<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a, R> CanRecoverFrom<(R,)> for Contra<'a>
where Contra<'a>: CanRecoverFrom<R>,

source§

impl<'a, R1, R2> CanRecoverFrom<(R1, R2)> for Contra<'a>
where Contra<'a>: CanRecoverFrom<R1> + CanRecoverFrom<R2>,

source§

impl<'a, R1, R2, R3> CanRecoverFrom<(R1, R2, R3)> for Contra<'a>

source§

impl<'a, R1, R2, R3, R4> CanRecoverFrom<(R1, R2, R3, R4)> for Contra<'a>

source§

impl<'a, R> CanRecoverFrom<Contra<'a>> for (R,)
where R: CanRecoverFrom<Contra<'a>>,

source§

impl<'a, R1, R2> CanRecoverFrom<Contra<'a>> for (R1, R2)
where R1: CanRecoverFrom<Contra<'a>>, R2: CanRecoverFrom<Contra<'a>>,

source§

impl<'a, R1, R2, R3> CanRecoverFrom<Contra<'a>> for (R1, R2, R3)
where R1: CanRecoverFrom<Contra<'a>>, R2: CanRecoverFrom<Contra<'a>>, R3: CanRecoverFrom<Contra<'a>>,

source§

impl<'a, R1, R2, R3, R4> CanRecoverFrom<Contra<'a>> for (R1, R2, R3, R4)

source§

impl<'a, 'b: 'a> CanRecoverFrom<Contra<'a>> for Contra<'b>

source§

impl<'a, 'b: 'a> CanRecoverFrom<Contra<'a>> for Inv<'b>

source§

impl<'a> CanRecoverFrom<Inv<'a>> for Contra<'a>

source§

impl<'a, R> CanTranscendTo<(R,)> for Contra<'a>
where Contra<'a>: CanTranscendTo<R>,

source§

impl<'a, R1, R2> CanTranscendTo<(R1, R2)> for Contra<'a>
where Contra<'a>: CanTranscendTo<R1> + CanTranscendTo<R2>,

source§

impl<'a, R1, R2, R3> CanTranscendTo<(R1, R2, R3)> for Contra<'a>

source§

impl<'a, R1, R2, R3, R4> CanTranscendTo<(R1, R2, R3, R4)> for Contra<'a>

source§

impl<'a, R> CanTranscendTo<Contra<'a>> for (R,)
where R: CanTranscendTo<Contra<'a>>,

source§

impl<'a, R1, R2> CanTranscendTo<Contra<'a>> for (R1, R2)
where R1: CanTranscendTo<Contra<'a>>, R2: CanTranscendTo<Contra<'a>>,

source§

impl<'a, R1, R2, R3> CanTranscendTo<Contra<'a>> for (R1, R2, R3)
where R1: CanTranscendTo<Contra<'a>>, R2: CanTranscendTo<Contra<'a>>, R3: CanTranscendTo<Contra<'a>>,

source§

impl<'a, R1, R2, R3, R4> CanTranscendTo<Contra<'a>> for (R1, R2, R3, R4)

source§

impl<'a, 'b: 'a> CanTranscendTo<Contra<'b>> for Contra<'a>

source§

impl<'a, 'b: 'a> CanTranscendTo<Inv<'b>> for Contra<'a>

source§

impl<'a> Copy for Contra<'a>

source§

impl<'a> Transience for Contra<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for Contra<'a>

§

impl<'a> RefUnwindSafe for Contra<'a>

§

impl<'a> Send for Contra<'a>

§

impl<'a> Sync for Contra<'a>

§

impl<'a> Unpin for Contra<'a>

§

impl<'a> UnwindSafe for Contra<'a>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.