pub struct ModuleData { /* private fields */ }Expand description
A loaded and resolved MIB module.
Contains module-level metadata (organization, description, revisions),
import declarations, and per-entity name indices. Access through the
public accessor methods or the Module handle.
Implementations§
Source§impl ModuleData
impl ModuleData
Sourcepub fn source_path(&self) -> &str
pub fn source_path(&self) -> &str
Return the file path this module was loaded from.
Sourcepub fn is_base(&self) -> bool
pub fn is_base(&self) -> bool
Return true if this is a synthetic base module.
See Module::is_base for details.
Sourcepub fn line_col(&self, offset: ByteOffset) -> (usize, usize)
pub fn line_col(&self, offset: ByteOffset) -> (usize, usize)
Convert a byte offset to a line and column number.
Sourcepub fn organization(&self) -> &str
pub fn organization(&self) -> &str
Return the ORGANIZATION clause text.
Sourcepub fn contact_info(&self) -> &str
pub fn contact_info(&self) -> &str
Return the CONTACT-INFO clause text.
Sourcepub fn description(&self) -> &str
pub fn description(&self) -> &str
Return the DESCRIPTION clause text.
Sourcepub fn last_updated(&self) -> &str
pub fn last_updated(&self) -> &str
Return the LAST-UPDATED timestamp string.
Sourcepub fn notifications(&self) -> &[NotificationId]
pub fn notifications(&self) -> &[NotificationId]
Return the notification ids defined by this module.
Sourcepub fn compliances(&self) -> &[ComplianceId]
pub fn compliances(&self) -> &[ComplianceId]
Return the compliance ids defined by this module.
Sourcepub fn capabilities(&self) -> &[CapabilityId]
pub fn capabilities(&self) -> &[CapabilityId]
Return the capability ids defined by this module.
Sourcepub fn object_by_name(&self, name: &str) -> Option<ObjectId>
pub fn object_by_name(&self, name: &str) -> Option<ObjectId>
Look up an object by name within this module.
Sourcepub fn type_by_name(&self, name: &str) -> Option<TypeId>
pub fn type_by_name(&self, name: &str) -> Option<TypeId>
Look up a type by name within this module.
Sourcepub fn notification_by_name(&self, name: &str) -> Option<NotificationId>
pub fn notification_by_name(&self, name: &str) -> Option<NotificationId>
Look up a notification by name within this module.
Sourcepub fn group_by_name(&self, name: &str) -> Option<GroupId>
pub fn group_by_name(&self, name: &str) -> Option<GroupId>
Look up a group by name within this module.
Sourcepub fn compliance_by_name(&self, name: &str) -> Option<ComplianceId>
pub fn compliance_by_name(&self, name: &str) -> Option<ComplianceId>
Look up a compliance statement by name within this module.
Sourcepub fn capability_by_name(&self, name: &str) -> Option<CapabilityId>
pub fn capability_by_name(&self, name: &str) -> Option<CapabilityId>
Look up a capability statement by name within this module.
Sourcepub fn node_by_name(&self, name: &str) -> Option<NodeId>
pub fn node_by_name(&self, name: &str) -> Option<NodeId>
Look up a node by name within this module.
Sourcepub fn symbol(&self, name: &str) -> Option<Symbol>
pub fn symbol(&self, name: &str) -> Option<Symbol>
Look up a symbol by name. Priority: objects, types, notifications, groups, compliances, capabilities, then plain nodes.
Sourcepub fn defines_symbol(&self, name: &str) -> bool
pub fn defines_symbol(&self, name: &str) -> bool
Return true if this module defines a symbol with the given name.
Sourcepub fn imports_symbol(&self, name: &str) -> bool
pub fn imports_symbol(&self, name: &str) -> bool
Return true if this module imports a symbol with the given name.
Sourcepub fn is_import_used(&self, name: &str) -> bool
pub fn is_import_used(&self, name: &str) -> bool
Return true if the named import was actually used during resolution.
Sourcepub fn import_source(&self, name: &str) -> Option<ModuleId>
pub fn import_source(&self, name: &str) -> Option<ModuleId>
Return the resolved source module for an imported name.
Sourcepub fn definitions(&self) -> impl Iterator<Item = Symbol> + '_
pub fn definitions(&self) -> impl Iterator<Item = Symbol> + '_
Yield all definitions in this module as Symbol values.
Entity-backed definitions (objects, types, notifications, groups, compliances, capabilities) come first. Plain nodes (not attached to any entity) are yielded last.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ModuleData
impl RefUnwindSafe for ModuleData
impl Send for ModuleData
impl Sync for ModuleData
impl Unpin for ModuleData
impl UnsafeUnpin for ModuleData
impl UnwindSafe for ModuleData
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more