pub struct Module {
pub name: String,
pub language: Language,
pub imports: Vec<Import>,
pub definitions: Vec<Definition>,
pub range: Option<SourceRange>,
pub diagnostics: Vec<Diagnostic>,
/* private fields */
}Expand description
A normalized, language-independent MIB module.
Lowering transforms AST structures into this simplified representation independent of whether the source was SMIv1 or SMIv2.
Fields§
§name: StringCanonical module name (e.g. "IF-MIB").
language: LanguageDetected SMI language version, or Language::Unknown when syntax and
imports provide insufficient or conflicting version evidence.
imports: Vec<Import>Flattened imports: one Import per imported symbol.
definitions: Vec<Definition>All definitions in source order.
range: Option<SourceRange>Range covering the entire module, or None for a generated module.
diagnostics: Vec<Diagnostic>Diagnostics collected during lowering.
Implementations§
Source§impl Module
impl Module
Sourcepub fn new(name: String, range: Option<SourceRange>) -> Self
pub fn new(name: String, range: Option<SourceRange>) -> Self
Creates a new module with the given name and source range. All other fields are initialized to empty/default values.
Sourcepub fn definition_names(&self) -> impl Iterator<Item = &str>
pub fn definition_names(&self) -> impl Iterator<Item = &str>
Returns an iterator over the names of all definitions.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Module
impl RefUnwindSafe for Module
impl Send for Module
impl Sync for Module
impl Unpin for Module
impl UnsafeUnpin for Module
impl UnwindSafe for Module
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