pub struct PureMod {
pub attrs: Vec<PureAttribute>,
pub vis: PureVis,
pub name: String,
pub items: Vec<PureItem>,
pub scope: ModScope,
}Expand description
A module definition.
Contains all items belonging to this module. File vs inline distinction is handled at the file system layer, not in the AST representation.
The scope field is the sole source of truth for #[cfg(test)] semantics.
Downstream layers (store, regen, emitter) must consume scope directly and
must not re-derive Prod/Test scope by inspecting attrs or items.is_empty().
Fields§
§attrs: Vec<PureAttribute>Attributes (both outer #[...] and inner #![...]).
Use PureAttribute::is_inner to distinguish.
vis: PureVisVisibility.
name: StringModule name.
items: Vec<PureItem>Module items.
scope: ModScopeProd/Test scope of this module.
ModScope::Test means this module is gated by #[cfg(test)].
Set at parse time; must not be re-derived from attrs or items in
any downstream layer.
Trait Implementations§
impl Eq for PureMod
impl StructuralPartialEq for PureMod
Auto Trait Implementations§
impl Freeze for PureMod
impl RefUnwindSafe for PureMod
impl Send for PureMod
impl Sync for PureMod
impl Unpin for PureMod
impl UnsafeUnpin for PureMod
impl UnwindSafe for PureMod
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