pub struct Env {
pub by_id: MapS<BindId, Bind>,
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>§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 Env
impl Env
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, doc: Option<ArcStr>, ) -> 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)
pub fn use_in_scope(&mut self, scope: &Scope, name: &ModPath) -> Result<()>
pub fn stop_use_in_scope(&mut self, scope: &Scope, name: &ModPath)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Env
impl !RefUnwindSafe for Env
impl Send for Env
impl Sync for Env
impl Unpin for Env
impl !UnwindSafe for Env
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