Struct debris_mir::namespace::MirNamespace
source · pub struct MirNamespace {
pub(crate) objects: Vec<MirObject>,
pub(crate) compilation_id: CompilationId,
pub(crate) local_namespaces: Vec<MirLocalNamespace>,
}
Fields§
§objects: Vec<MirObject>
The objects are indexed by MirObjectId.id
For this reason, no object may ever be removed from this vec
compilation_id: CompilationId
§local_namespaces: Vec<MirLocalNamespace>
Implementations§
source§impl MirNamespace
impl MirNamespace
pub fn new(ctx: &CompileContext) -> Self
sourcepub fn insert_object(
&mut self,
current_context_id: MirContextId
) -> &mut MirObject
pub fn insert_object( &mut self, current_context_id: MirContextId ) -> &mut MirObject
Creates a new object. This object stores the current context id as the place where it was defined
pub fn get_obj_mut(&mut self, obj: MirObjectId) -> &mut MirObject
pub fn get_obj(&self, obj: MirObjectId) -> &MirObject
pub fn insert_local_namespace(&mut self) -> MirLocalNamespaceId
pub fn get_local_namespace(&self, id: MirLocalNamespaceId) -> &MirLocalNamespace
pub fn get_local_namespace_mut( &mut self, id: MirLocalNamespaceId ) -> &mut MirLocalNamespace
pub fn get_obj_namespace(&self, obj_id: MirObjectId) -> &MirLocalNamespace
pub fn get_obj_namespace_mut( &mut self, obj_id: MirObjectId ) -> &mut MirLocalNamespace
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for MirNamespace
impl Send for MirNamespace
impl Sync for MirNamespace
impl Unpin for MirNamespace
impl UnwindSafe for MirNamespace
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