pub trait Source: Send + Sync {
// Required methods
fn find(&self, name: &str) -> Result<Option<FindResult>>;
fn list_modules(&self) -> Result<Vec<String>>;
}Expand description
Provides access to MIB files for the loading pipeline.
Implementations must be Send + Sync to support parallel loading.
The library ships several constructors:
file()/files()- individual files on diskdir/dir_with_config- directory tree on diskdirs()- multiple directory trees combinedmemory/memory_modules- in-memory contentchain- combine arbitrary sources in priority order
Required Methods§
Sourcefn find(&self, name: &str) -> Result<Option<FindResult>>
fn find(&self, name: &str) -> Result<Option<FindResult>>
Look up a module by name and return its content and source path.
Returns Ok(None) if this source does not contain the named module.
The name parameter is the MIB module name (e.g. "IF-MIB"), not a
filename.
§Errors
Returns io::Error if the underlying storage cannot be read (e.g.
file I/O failure, permission denied).