pub struct Module<'a> { /* private fields */ }Expand description
Borrowed handle to a resolved ModuleData.
Wraps a Mib reference and an arena id. Handles are Copy and
cheap to pass around. Two handles are equal when they point to the
same arena slot in the same Mib.
Implementations§
Source§impl<'a> Module<'a>
impl<'a> Module<'a>
Sourcepub fn source_path(self) -> &'a str
pub fn source_path(self) -> &'a str
Return the file path this module was loaded from.
Sourcepub fn organization(self) -> &'a str
pub fn organization(self) -> &'a str
Return the ORGANIZATION clause text from MODULE-IDENTITY.
Sourcepub fn contact_info(self) -> &'a str
pub fn contact_info(self) -> &'a str
Return the CONTACT-INFO clause text from MODULE-IDENTITY.
Sourcepub fn description(self) -> &'a str
pub fn description(self) -> &'a str
Return the DESCRIPTION clause text from MODULE-IDENTITY.
Sourcepub fn last_updated(self) -> &'a str
pub fn last_updated(self) -> &'a str
Return the LAST-UPDATED timestamp string from MODULE-IDENTITY.
Sourcepub fn is_base(self) -> bool
pub fn is_base(self) -> bool
Return true if this is a synthetic base module (SNMPv2-SMI, etc.).
Base modules define the SMI language itself and are constructed
programmatically rather than parsed from files. They have no real
source text, so spans are Span::SYNTHETIC
and source_path() returns an empty string. See the crate-level
docs for the full list of base modules and their contents.
Sourcepub fn oid(self) -> Option<&'a Oid>
pub fn oid(self) -> Option<&'a Oid>
Return the module’s registered OID from its MODULE-IDENTITY, if any.
Sourcepub fn line_col(self, offset: ByteOffset) -> (usize, usize)
pub fn line_col(self, offset: ByteOffset) -> (usize, usize)
Convert a byte offset within this module’s source to a line and column number.
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 import_source(self, name: &str) -> Option<Module<'a>>
pub fn import_source(self, name: &str) -> Option<Module<'a>>
Return the resolved source module for an imported name.
Sourcepub fn object(self, name: &str) -> Option<Object<'a>>
pub fn object(self, name: &str) -> Option<Object<'a>>
Look up an object defined by this module.
Sourcepub fn notification(self, name: &str) -> Option<Notification<'a>>
pub fn notification(self, name: &str) -> Option<Notification<'a>>
Look up a notification defined by this module.
Sourcepub fn compliance(self, name: &str) -> Option<Compliance<'a>>
pub fn compliance(self, name: &str) -> Option<Compliance<'a>>
Look up a compliance statement defined by this module.
Sourcepub fn capability(self, name: &str) -> Option<Capability<'a>>
pub fn capability(self, name: &str) -> Option<Capability<'a>>
Look up a capabilities statement defined by this module.
Sourcepub fn objects(self) -> impl Iterator<Item = Object<'a>> + 'a
pub fn objects(self) -> impl Iterator<Item = Object<'a>> + 'a
Iterate objects defined by this module.
Trait Implementations§
impl<'a> Copy for Module<'a>
impl Eq for Module<'_>
Auto Trait Implementations§
impl<'a> Freeze for Module<'a>
impl<'a> RefUnwindSafe for Module<'a>
impl<'a> Send for Module<'a>
impl<'a> Sync for Module<'a>
impl<'a> Unpin for Module<'a>
impl<'a> UnsafeUnpin for Module<'a>
impl<'a> UnwindSafe for Module<'a>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
key and return true if they are equal.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§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