pub struct Env<'k> {
Show 16 fields pub adt_ids: &'k BTreeMap<Identifier, AdtId<ChalkIr>>, pub adt_kinds: &'k BTreeMap<AdtId<ChalkIr>, TypeKind>, pub fn_def_ids: &'k BTreeMap<Identifier, FnDefId<ChalkIr>>, pub fn_def_kinds: &'k BTreeMap<FnDefId<ChalkIr>, TypeKind>, pub closure_ids: &'k BTreeMap<Identifier, ClosureId<ChalkIr>>, pub closure_kinds: &'k BTreeMap<ClosureId<ChalkIr>, TypeKind>, pub trait_ids: &'k BTreeMap<Identifier, TraitId<ChalkIr>>, pub trait_kinds: &'k BTreeMap<TraitId<ChalkIr>, TypeKind>, pub opaque_ty_ids: &'k BTreeMap<Identifier, OpaqueTyId<ChalkIr>>, pub opaque_ty_kinds: &'k BTreeMap<OpaqueTyId<ChalkIr>, TypeKind>, pub associated_ty_lookups: &'k BTreeMap<(TraitId<ChalkIr>, Identifier), AssociatedTyLookup>, pub auto_traits: &'k BTreeMap<TraitId<ChalkIr>, bool>, pub foreign_ty_ids: &'k BTreeMap<Identifier, ForeignDefId<ChalkIr>>, pub coroutine_ids: &'k BTreeMap<Identifier, CoroutineId<ChalkIr>>, pub coroutine_kinds: &'k BTreeMap<CoroutineId<ChalkIr>, TypeKind>, pub parameter_map: BTreeMap<Identifier, WithKind<ChalkIr, BoundVar>>,
}

Fields§

§adt_ids: &'k BTreeMap<Identifier, AdtId<ChalkIr>>§adt_kinds: &'k BTreeMap<AdtId<ChalkIr>, TypeKind>§fn_def_ids: &'k BTreeMap<Identifier, FnDefId<ChalkIr>>§fn_def_kinds: &'k BTreeMap<FnDefId<ChalkIr>, TypeKind>§closure_ids: &'k BTreeMap<Identifier, ClosureId<ChalkIr>>§closure_kinds: &'k BTreeMap<ClosureId<ChalkIr>, TypeKind>§trait_ids: &'k BTreeMap<Identifier, TraitId<ChalkIr>>§trait_kinds: &'k BTreeMap<TraitId<ChalkIr>, TypeKind>§opaque_ty_ids: &'k BTreeMap<Identifier, OpaqueTyId<ChalkIr>>§opaque_ty_kinds: &'k BTreeMap<OpaqueTyId<ChalkIr>, TypeKind>§associated_ty_lookups: &'k BTreeMap<(TraitId<ChalkIr>, Identifier), AssociatedTyLookup>§auto_traits: &'k BTreeMap<TraitId<ChalkIr>, bool>§foreign_ty_ids: &'k BTreeMap<Identifier, ForeignDefId<ChalkIr>>§coroutine_ids: &'k BTreeMap<Identifier, CoroutineId<ChalkIr>>§coroutine_kinds: &'k BTreeMap<CoroutineId<ChalkIr>, TypeKind>§parameter_map: BTreeMap<Identifier, WithKind<ChalkIr, BoundVar>>

GenericArg identifiers are used as keys, therefore all identifiers in an environment must be unique (no shadowing).

Implementations§

source§

impl Env<'_>

source

pub fn interner(&self) -> ChalkIr

source

pub fn lookup_generic_arg( &self, name: &Identifier ) -> Result<GenericArg<ChalkIr>, RustIrError>

source

pub fn lookup_type( &self, name: &Identifier ) -> Result<TypeLookup<'_>, RustIrError>

source

pub fn auto_trait(&self, id: TraitId<ChalkIr>) -> bool

source

pub fn lookup_trait( &self, name: &Identifier ) -> Result<TraitId<ChalkIr>, RustIrError>

source

pub fn trait_kind(&self, id: TraitId<ChalkIr>) -> &TypeKind

source

pub fn adt_kind(&self, id: AdtId<ChalkIr>) -> &TypeKind

source

pub fn fn_def_kind(&self, id: FnDefId<ChalkIr>) -> &TypeKind

source

pub fn closure_kind(&self, id: ClosureId<ChalkIr>) -> &TypeKind

source

pub fn opaque_kind(&self, id: OpaqueTyId<ChalkIr>) -> &TypeKind

source

pub fn coroutine_kind(&self, id: CoroutineId<ChalkIr>) -> &TypeKind

source

pub fn lookup_associated_ty( &self, trait_id: TraitId<ChalkIr>, ident: &Identifier ) -> Result<&AssociatedTyLookup, RustIrError>

source

pub fn introduce<I>(&self, binders: I) -> Result<Self, RustIrError>

Introduces new parameters, shifting the indices of existing parameters to accommodate them. The indices of the new binders will be assigned in order as they are iterated.

source

pub fn in_binders<I, T, OP>( &self, binders: I, op: OP ) -> Result<Binders<T>, RustIrError>

Trait Implementations§

source§

impl<'k> Clone for Env<'k>

source§

fn clone(&self) -> Env<'k>

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<'k> Debug for Env<'k>

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'k> RefUnwindSafe for Env<'k>

§

impl<'k> Send for Env<'k>

§

impl<'k> Sync for Env<'k>

§

impl<'k> Unpin for Env<'k>

§

impl<'k> UnwindSafe for Env<'k>

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> Cast for T

source§

fn cast<U>(self, interner: <U as HasInterner>::Interner) -> U
where Self: CastTo<U>, U: HasInterner,

Cast a value to type U using CastTo.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.
source§

impl<T, U> Upcast<U> for T
where U: UpcastFrom<T> + ?Sized, T: ?Sized,

source§

fn upcast(&self) -> &U

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more