pub struct ModuleNode {
pub node_id: NodeId,
pub name: String,
pub parent: Option<Id<ModuleNode>>,
pub children: Vec<AnyId>,
pub facets: Facets,
}Expand description
A namespace. Spec §3.1.
Reopening a module in a second translation unit merges into the same
node rather than creating a second one; see
crate::Ast::ensure_module. That is the structural resolution of
the per-file fragmentation that previously needed an opt-in dedup
pass on multi-input builds.
Fields§
§node_id: NodeIdStable identity.
name: StringSimple name. Empty for the root module.
parent: Option<Id<ModuleNode>>Enclosing module; None only for the root.
children: Vec<AnyId>Everything declared directly inside, in declaration order.
facets: FacetsPer-source information. A module reopened across files records the first origin; the rest live in the changeset history. Spec §4.7.
Implementations§
Trait Implementations§
Source§impl Clone for ModuleNode
impl Clone for ModuleNode
Source§impl Debug for ModuleNode
impl Debug for ModuleNode
impl Eq for ModuleNode
Source§impl PartialEq for ModuleNode
impl PartialEq for ModuleNode
impl StructuralPartialEq for ModuleNode
Auto Trait Implementations§
impl Freeze for ModuleNode
impl RefUnwindSafe for ModuleNode
impl Send for ModuleNode
impl Sync for ModuleNode
impl Unpin for ModuleNode
impl UnsafeUnpin for ModuleNode
impl UnwindSafe for ModuleNode
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