pub struct Env {
pub(crate) env: BTreeMap<Path, ModuleEnv>,
}
Expand description
The type resolution environment
Also contains the entire module structure
Fields§
§env: BTreeMap<Path, ModuleEnv>
Implementations§
source§impl Env
impl Env
pub(crate) fn insert(&mut self, path: Path, module: ModuleEnv)
sourcepub fn get(&self, path: &Path, name: &str) -> Option<&ModSymbol>
pub fn get(&self, path: &Path, name: &str) -> Option<&ModSymbol>
Given a path to a module and a name, get the item, if any
sourcepub fn iter_items(
&self,
) -> impl Iterator<Item = (&Path, &Ident, &ModSymbol)> + '_
pub fn iter_items( &self, ) -> impl Iterator<Item = (&Path, &Ident, &ModSymbol)> + '_
Iterate over all items in the environment
This will occur in a stable lexically sorted order by path and then name
sourcepub fn iter_modules(&self) -> impl Iterator<Item = (&Path, &ModuleEnv)> + '_
pub fn iter_modules(&self) -> impl Iterator<Item = (&Path, &ModuleEnv)> + '_
Iterate over all modules
This will occur in a stable lexically sorted order by path
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<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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)