Skip to main content

Source

Trait Source 

Source
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:

Required Methods§

Source

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).

Source

fn list_modules(&self) -> Result<Vec<String>>

List all module names available from this source.

The returned names should match what find accepts. Callers use this to discover modules when no explicit module list is provided to the loader.

§Errors

Returns io::Error if listing fails (e.g. directory read error).

Implementors§