[][src]Struct chalk_ir::Variances

pub struct Variances<I: Interner> { /* fields omitted */ }

List of variable kinds with universe index. Wraps InternedCanonicalVarKinds.

Implementations

impl<I: Interner> Variances<I>[src]

pub fn empty(interner: &I) -> Self[src]

Creates an empty list of canonical variable kinds.

pub fn interned(&self) -> &I::InternedVariances[src]

Get the interned canonical variable kinds.

pub fn from(interner: &I, variances: impl IntoIterator<Item = Variance>) -> Self[src]

Creates a list of canonical variable kinds using an iterator.

pub fn from_fallible<E>(
    interner: &I,
    variances: impl IntoIterator<Item = Result<Variance, E>>
) -> Result<Self, E>
[src]

Tries to create a list of canonical variable kinds using an iterator.

pub fn from1(interner: &I, variance: Variance) -> Self[src]

Creates a list of canonical variable kinds from a single canonical variable kind.

pub fn iter(&self, interner: &I) -> Iter<'_, Variance>[src]

Get an iterator over the list of canonical variable kinds.

pub fn is_empty(&self, interner: &I) -> bool[src]

Checks whether the list of canonical variable kinds is empty.

pub fn len(&self, interner: &I) -> usize[src]

Returns the number of canonical variable kinds.

pub fn as_slice(&self, interner: &I) -> &[Variance][src]

Returns a slice containing the canonical variable kinds.

Trait Implementations

impl<I: Clone + Interner> Clone for Variances<I> where
    I::InternedVariances: Clone
[src]

impl<I: Copy + Interner> Copy for Variances<I> where
    I::InternedVariances: Copy
[src]

impl<I: Eq + Interner> Eq for Variances<I> where
    I::InternedVariances: Eq
[src]

impl<I: Interner> HasInterner for Variances<I>[src]

type Interner = I

The interner associated with the type.

impl<I: Hash + Interner> Hash for Variances<I> where
    I::InternedVariances: Hash
[src]

impl<I: Ord + Interner> Ord for Variances<I> where
    I::InternedVariances: Ord
[src]

impl<I: PartialEq + Interner> PartialEq<Variances<I>> for Variances<I> where
    I::InternedVariances: PartialEq
[src]

impl<I: PartialOrd + Interner> PartialOrd<Variances<I>> for Variances<I> where
    I::InternedVariances: PartialOrd
[src]

impl<I: Interner> StructuralEq for Variances<I>[src]

impl<I: Interner> StructuralPartialEq for Variances<I>[src]

Auto Trait Implementations

impl<I> RefUnwindSafe for Variances<I> where
    <I as Interner>::InternedVariances: RefUnwindSafe

impl<I> Send for Variances<I> where
    <I as Interner>::InternedVariances: Send

impl<I> Sync for Variances<I> where
    <I as Interner>::InternedVariances: Sync

impl<I> Unpin for Variances<I> where
    <I as Interner>::InternedVariances: Unpin

impl<I> UnwindSafe for Variances<I> where
    <I as Interner>::InternedVariances: UnwindSafe

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> Cast for T[src]

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.