Skip to main content

LibLoader

Trait LibLoader 

Source
pub trait LibLoader: Send + Sync {
    // Required methods
    fn can_load(&self, source: &LibSource) -> bool;
    fn load(&self, cx: &mut Cx, source: LibSource) -> Result<Box<dyn Lib>>;

    // Provided method
    fn inspect_manifest(
        &self,
        _cx: &mut Cx,
        _source: &LibSource,
    ) -> Result<Option<LibManifest>> { ... }
}
Expand description

A loader that can turn a LibSource into a Lib.

Loaders are themselves library behavior; the kernel only defines the contract for plugging them in.

Required Methods§

Source

fn can_load(&self, source: &LibSource) -> bool

Reports whether this loader accepts the given source.

Source

fn load(&self, cx: &mut Cx, source: LibSource) -> Result<Box<dyn Lib>>

Loads the source into a library object.

Provided Methods§

Source

fn inspect_manifest( &self, _cx: &mut Cx, _source: &LibSource, ) -> Result<Option<LibManifest>>

Inspects a source’s manifest without fully loading it; the default returns None (not supported).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§