Type Alias Variances

Source
pub type Variances = Variances<Interner>;

Aliased Type§

struct Variances { /* private fields */ }

Implementations

§

impl<I> Variances<I>
where I: Interner,

pub fn from_fallible<E>( interner: I, variances: impl IntoIterator<Item = Result<Variance, E>>, ) -> Result<Variances<I>, E>

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

pub fn from_iter( interner: I, variances: impl IntoIterator<Item = Variance>, ) -> Variances<I>

Creates a list of canonical variable kinds using an iterator.

pub fn from1(interner: I, variance: Variance) -> Variances<I>

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

§

impl<I> Variances<I>
where I: Interner,

pub fn interned(&self) -> &<I as Interner>::InternedVariances

Get the interned elements.

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

Returns a slice containing the elements.

pub fn at(&self, interner: I, index: usize) -> &Variance

Index into the sequence.

pub fn empty(interner: I) -> Variances<I>

Create an empty sequence.

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

Check whether this is an empty sequence.

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

Get an iterator over the elements of the sequence.

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

Get the length of the sequence.

Trait Implementations

§

impl<I> Clone for Variances<I>
where I: Clone + Interner, <I as Interner>::InternedVariances: Clone,

§

fn clone(&self) -> Variances<I>

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
§

impl<I> Debug for Variances<I>
where I: Interner,

§

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

Formats the value using the given formatter. Read more
§

impl<I> HasInterner for Variances<I>
where I: Interner,

§

type Interner = I

The interner associated with the type.
§

impl<I> Hash for Variances<I>
where I: Hash + Interner, <I as Interner>::InternedVariances: Hash,

§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl<I> Ord for Variances<I>
where I: Ord + Interner, <I as Interner>::InternedVariances: Ord,

§

fn cmp(&self, other: &Variances<I>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
§

impl<I> PartialEq for Variances<I>
where I: PartialEq + Interner, <I as Interner>::InternedVariances: PartialEq,

§

fn eq(&self, other: &Variances<I>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<I> PartialOrd for Variances<I>
where I: PartialOrd + Interner, <I as Interner>::InternedVariances: PartialOrd,

§

fn partial_cmp(&self, other: &Variances<I>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
§

impl<I> Copy for Variances<I>
where I: Copy + Interner, <I as Interner>::InternedVariances: Copy,

§

impl<I> Eq for Variances<I>
where I: Eq + Interner, <I as Interner>::InternedVariances: Eq,

§

impl<I> StructuralPartialEq for Variances<I>
where I: Interner,