pub struct Namespace { /* private fields */ }
Expand description
The set of items that represent the namespace context passed throughout type checking.
Implementations§
source§impl Namespace
impl Namespace
sourcepub fn init_root(init: Module) -> Self
pub fn init_root(init: Module) -> Self
Initialise the namespace at its root from the given initial namespace.
sourcepub fn mod_path(&self) -> &Path
pub fn mod_path(&self) -> &Path
A reference to the path of the module currently being type-checked.
sourcepub fn find_module_path<'a>(
&'a self,
prefixes: impl IntoIterator<Item = &'a Ident>
) -> PathBuf
pub fn find_module_path<'a>(
&'a self,
prefixes: impl IntoIterator<Item = &'a Ident>
) -> PathBuf
Find the module that these prefixes point to
sourcepub fn root_mut(&mut self) -> &mut Root
pub fn root_mut(&mut self) -> &mut Root
A mutable reference to the root of the project namespace.
Methods from Deref<Target = Module>§
sourcepub fn submodules(&self) -> &OrdMap<String, Module>
pub fn submodules(&self) -> &OrdMap<String, Module>
Immutable access to this module’s submodules.
sourcepub fn insert_submodule(&mut self, name: String, submodule: Module)
pub fn insert_submodule(&mut self, name: String, submodule: Module)
Insert a submodule into this Module
.
sourcepub fn submodule(&self, path: &Path) -> Option<&Module>
pub fn submodule(&self, path: &Path) -> Option<&Module>
Lookup the submodule at the given path.
sourcepub fn submodule_mut(&mut self, path: &Path) -> Option<&mut Module>
pub fn submodule_mut(&mut self, path: &Path) -> Option<&mut Module>
Unique access to the submodule at the given path.
sourcepub fn star_import_with_reexports(
&mut self,
src: &Path,
dst: &Path,
engines: Engines<'_>
) -> CompileResult<()>
pub fn star_import_with_reexports(
&mut self,
src: &Path,
dst: &Path,
engines: Engines<'_>
) -> CompileResult<()>
Given a path to a src
module, create synonyms to every symbol in that module to the given
dst
module.
This is used when an import path contains an asterisk.
Paths are assumed to be relative to self
.
Methods from Deref<Target = Items>§
sourcepub fn symbols(&self) -> &OrdMap<Ident, TyDeclaration>
pub fn symbols(&self) -> &OrdMap<Ident, TyDeclaration>
Immutable access to the inner symbol map.