pub struct Env<R: Rt, E: UserEvent> {
pub by_id: MapS<BindId, Bind>,
pub lambdas: MapS<LambdaId, Weak<LambdaDef<R, E>>>,
pub byref_chain: MapS<BindId, BindId>,
pub binds: MapS<ModPath, MapS<CompactString, BindId>>,
pub used: MapS<ModPath, Arc<Vec<ModPath>>>,
pub modules: SetS<ModPath>,
pub typedefs: MapS<ModPath, MapS<CompactString, TypeDef>>,
pub catch: MapS<ModPath, BindId>,
}Fields§
§by_id: MapS<BindId, Bind>§lambdas: MapS<LambdaId, Weak<LambdaDef<R, E>>>§byref_chain: MapS<BindId, BindId>§binds: MapS<ModPath, MapS<CompactString, BindId>>§used: MapS<ModPath, Arc<Vec<ModPath>>>§modules: SetS<ModPath>§typedefs: MapS<ModPath, MapS<CompactString, TypeDef>>§catch: MapS<ModPath, BindId>Implementations§
Source§impl<R: Rt, E: UserEvent> Env<R, E>
impl<R: Rt, E: UserEvent> Env<R, E>
pub fn apply_sandbox(&self, spec: &Sandbox) -> Result<Self>
pub fn find_visible<T, F: FnMut(&str, &str) -> Option<T>>( &self, scope: &ModPath, name: &ModPath, f: F, ) -> Option<T>
pub fn lookup_bind( &self, scope: &ModPath, name: &ModPath, ) -> Option<(&ModPath, &Bind)>
pub fn lookup_typedef( &self, scope: &ModPath, name: &ModPath, ) -> Option<&TypeDef>
Sourcepub fn lookup_catch(&self, scope: &ModPath) -> Result<BindId>
pub fn lookup_catch(&self, scope: &ModPath) -> Result<BindId>
lookup the bind id of the nearest catch handler in this scope
Sourcepub fn lookup_matching(
&self,
scope: &ModPath,
part: &ModPath,
) -> Vec<(CompactString, BindId)>
pub fn lookup_matching( &self, scope: &ModPath, part: &ModPath, ) -> Vec<(CompactString, BindId)>
lookup binds in scope that match the specified partial name. This is intended to be used for IDEs and interactive shells, and is not used by the compiler.
Sourcepub fn lookup_matching_modules(
&self,
scope: &ModPath,
part: &ModPath,
) -> Vec<ModPath>
pub fn lookup_matching_modules( &self, scope: &ModPath, part: &ModPath, ) -> Vec<ModPath>
lookup modules in scope that match the specified partial name. This is intended to be used for IDEs and interactive shells, and is not used by the compiler.
pub fn canonical_modpath( &self, scope: &ModPath, name: &ModPath, ) -> Option<ModPath>
pub fn deftype( &mut self, scope: &ModPath, name: &str, params: Arc<[(TVar, Option<Type>)]>, typ: Type, ) -> Result<()>
pub fn undeftype(&mut self, scope: &ModPath, name: &str)
Sourcepub fn bind_variable(
&mut self,
scope: &ModPath,
name: &str,
typ: Type,
) -> &mut Bind
pub fn bind_variable( &mut self, scope: &ModPath, name: &str, typ: Type, ) -> &mut Bind
create a new binding. If an existing bind exists in the same scope shadow it.
Sourcepub fn alias_variable(&mut self, scope: &ModPath, name: &str, id: BindId)
pub fn alias_variable(&mut self, scope: &ModPath, name: &str, id: BindId)
make the specified name an alias for id
pub fn unbind_variable(&mut self, id: BindId)
Trait Implementations§
Auto Trait Implementations§
impl<R, E> Freeze for Env<R, E>
impl<R, E> !RefUnwindSafe for Env<R, E>
impl<R, E> Send for Env<R, E>
impl<R, E> Sync for Env<R, E>
impl<R, E> Unpin for Env<R, E>
impl<R, E> !UnwindSafe for Env<R, E>
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more