Struct rustc_resolve::Module
source · pub(crate) struct Module<'a>(pub(crate) Interned<'a, ModuleData<'a>>);
Expand description
All modules are unique and allocated on a same arena, so we can use referential equality to compare them.
Tuple Fields§
§0: Interned<'a, ModuleData<'a>>
Implementations§
source§impl<'a> Module<'a>
impl<'a> Module<'a>
pub(crate) fn for_each_child<'tcx, R, F>(self, resolver: &mut R, f: F)where R: AsMut<Resolver<'a, 'tcx>>, F: FnMut(&mut R, Ident, Namespace, Interned<'a, NameBindingData<'a>>),
sourcepub(crate) fn ensure_traits<'tcx, R>(self, resolver: &mut R)where
R: AsMut<Resolver<'a, 'tcx>>,
pub(crate) fn ensure_traits<'tcx, R>(self, resolver: &mut R)where R: AsMut<Resolver<'a, 'tcx>>,
This modifies self
in place. The traits will be stored in self.traits
.
pub(crate) fn res(self) -> Option<Res<NodeId>>
pub(crate) fn def_id(self) -> DefId
pub(crate) fn opt_def_id(self) -> Option<DefId>
pub(crate) fn is_normal(self) -> bool
pub(crate) fn is_trait(self) -> bool
pub(crate) fn nearest_item_scope(self) -> Module<'a>
sourcepub(crate) fn nearest_parent_mod(self) -> DefId
pub(crate) fn nearest_parent_mod(self) -> DefId
The DefId
of the nearest mod
item ancestor (which may be this module).
This may be the crate root.
pub(crate) fn is_ancestor_of(self, other: Self) -> bool
Trait Implementations§
source§impl<'a> PartialEq<Module<'a>> for Module<'a>
impl<'a> PartialEq<Module<'a>> for Module<'a>
impl<'a> Copy for Module<'a>
impl<'a> Eq for Module<'a>
impl<'a> StructuralEq for Module<'a>
impl<'a> StructuralPartialEq for Module<'a>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Module<'a>
impl<'a> !Send for Module<'a>
impl<'a> !Sync for Module<'a>
impl<'a> Unpin for Module<'a>
impl<'a> !UnwindSafe for Module<'a>
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
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 8 bytes