[][src]Struct chalk_ir::Binders

pub struct Binders<T> {
    pub binders: Vec<ParameterKind<()>>,
    pub value: T,
}

Indicates that the value is universally quantified over N parameters of the given kinds, where N == self.binders.len(). A variable with depth i < N refers to the value at self.binders[i]. Variables with depth >= N are free.

(IOW, we use deBruijn indices, where binders are introduced in reverse order of self.binders.)

Fields

binders: Vec<ParameterKind<()>>value: T

Methods

impl<T> Binders<T>[src]

pub fn map<U, OP>(self, op: OP) -> Binders<U> where
    OP: FnOnce(T) -> U, 
[src]

pub fn map_ref<U, OP>(&self, op: OP) -> Binders<U> where
    OP: FnOnce(&T) -> U, 
[src]

pub fn with_fresh_type_var<U, OP>(self, op: OP) -> Binders<U> where
    OP: FnOnce(<T as Fold>::Result, Ty) -> U,
    T: Shift
[src]

Introduces a fresh type variable at the start of the binders and returns new Binders with the result of the operator function applied.

forall<?0, ?1> will become forall<?0, ?1, ?2> where ?0 is the fresh variable

pub fn len(&self) -> usize[src]

Trait Implementations

impl<T: Zip + Fold<Result = T>> Zip for Binders<T>[src]

impl<T> Fold for Binders<T> where
    T: Fold
[src]

type Result = Binders<T::Result>

The type of value that will be produced once folding is done. Typically this is Self, unless Self contains borrowed values, in which case owned values are produced (for example, one can fold over a &T value where T: Fold, in which case you get back a T, not a &T). Read more

impl<T: Cast<Goal>> Cast<Goal> for Binders<T>[src]

impl<T: Cast<DomainGoal>> Cast<ProgramClause> for Binders<T>[src]

impl Cast<ProgramClause> for Binders<ProgramClauseImplication>[src]

impl<T: Eq> Eq for Binders<T>[src]

impl<T: PartialEq> PartialEq<Binders<T>> for Binders<T>[src]

impl<T: Clone> Clone for Binders<T>[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<T: Ord> Ord for Binders<T>[src]

fn max(self, other: Self) -> Self1.21.0[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self1.21.0[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

🔬 This is a nightly-only experimental API. (clamp)

Restrict a value to a certain interval. Read more

impl<V: IntoIterator> IntoIterator for Binders<V>[src]

Allows iterating over a Binders<Vec>, for instance. Each element will include the same set of parameter bounds.

type Item = Binders<<V as IntoIterator>::Item>

The type of the elements being iterated over.

type IntoIter = BindersIntoIterator<V>

Which kind of iterator are we turning this into?

impl<T: PartialOrd> PartialOrd<Binders<T>> for Binders<T>[src]

impl<T: Hash> Hash for Binders<T>[src]

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

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

impl<T: Debug> Debug for Binders<T>[src]

Auto Trait Implementations

impl<T> Send for Binders<T> where
    T: Send

impl<T> Sync for Binders<T> where
    T: Sync

Blanket Implementations

impl<T> Shift for T where
    T: Fold + Eq
[src]

impl<T> Cast<Goal> for T where
    T: Cast<LeafGoal>, 
[src]

impl<T> Cast<ProgramClause> for T where
    T: Cast<DomainGoal>, 
[src]

impl<T> CouldMatch<T> for T where
    T: Zip
[src]

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

type Owned = T

The resulting type after obtaining ownership.

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

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

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

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.

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

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

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