Trait Loader

Source
pub trait Loader {
    type Instance: Instance;
    type Error: Debug;

    // Required method
    fn load(
        &self,
        rm: &dyn RunnableModule,
        module: &ModuleInfo,
        ctx: &Ctx,
    ) -> Result<Self::Instance, Self::Error>;
}
Expand description

The loader trait represents the functions used to load an instance.

Required Associated Types§

Source

type Instance: Instance

The type of Instance for the loader.

Source

type Error: Debug

The error type returned by the loader.

Required Methods§

Source

fn load( &self, rm: &dyn RunnableModule, module: &ModuleInfo, ctx: &Ctx, ) -> Result<Self::Instance, Self::Error>

Loads the given module and context into an instance.

Implementors§