pub struct Module {
pub name: Option<Ident>,
pub imports: Vec<ImportClause>,
pub body: Vec<Definition>,
pub span: SourceRange,
pub diagnostics: Vec<Diagnostic>,
}Expand description
Top-level AST node for a parsed MIB module.
Produced by the parser from a single MIB source file. Contains the
module’s ImportClauses, body Definitions, and any diagnostics
emitted during parsing.
Fields§
§name: Option<Ident>Module name (e.g. IF-MIB). None if parsing failed before the header.
imports: Vec<ImportClause>IMPORTS ... ; clauses.
body: Vec<Definition>Definitions in the module body, between BEGIN and END.
span: SourceRangeSource range covering the entire module.
diagnostics: Vec<Diagnostic>Diagnostics collected during parsing.
Implementations§
Source§impl Module
impl Module
Sourcepub fn new(name: Ident, span: SourceRange) -> Self
pub fn new(name: Ident, span: SourceRange) -> Self
Creates a new module with the given name and span, and empty imports/body/diagnostics.
Sourcepub fn has_errors(&self) -> bool
pub fn has_errors(&self) -> bool
Reports whether any diagnostic has error severity or worse.
Trait Implementations§
impl Eq for Module
impl StructuralPartialEq for Module
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
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.