Struct sway_core::semantic_analysis::namespace::SubmoduleNamespace
source · [−]pub struct SubmoduleNamespace<'a> { /* private fields */ }
Expand description
A namespace session type representing the type-checking of a submodule.
This type allows for re-using the parent’s Namespace
in order to provide access to the
root
and init
throughout type-checking of the submodule, but with an updated mod_path
to
represent the submodule’s path. When dropped, the SubmoduleNamespace
reset’s the
Namespace
’s mod_path
to the parent module path so that type-checking of the parent may
continue.
Methods from Deref<Target = 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.
Methods from Deref<Target = Items>
sourcepub fn symbols(&self) -> &OrdMap<Ident, TypedDeclaration>
pub fn symbols(&self) -> &OrdMap<Ident, TypedDeclaration>
Immutable access to the inner symbol map.
pub fn apply_storage_load(
&self,
fields: Vec<Ident>,
storage_fields: &[TypedStorageField]
) -> CompileResult<(TypeCheckedStorageAccess, TypeId)>
pub fn set_storage_declaration(
&mut self,
decl: TypedStorageDeclaration
) -> CompileResult<()>
pub fn get_all_declared_symbols(
&self
) -> impl Iterator<Item = &TypedDeclaration>
Trait Implementations
sourceimpl<'a> Deref for SubmoduleNamespace<'a>
impl<'a> Deref for SubmoduleNamespace<'a>
sourceimpl<'a> DerefMut for SubmoduleNamespace<'a>
impl<'a> DerefMut for SubmoduleNamespace<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for SubmoduleNamespace<'a>
impl<'a> Send for SubmoduleNamespace<'a>
impl<'a> Sync for SubmoduleNamespace<'a>
impl<'a> Unpin for SubmoduleNamespace<'a>
impl<'a> !UnwindSafe for SubmoduleNamespace<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more