Skip to main content

ModuleResolver

Trait ModuleResolver 

Source
pub trait ModuleResolver: Debug {
    // Required method
    fn try_resolve(
        &self,
        context: &mut Rant,
        module_path: &str,
        dependant: Option<&RantProgramInfo>,
    ) -> ModuleResolveResult;
}
Expand description

Represents the features required for a module resolver.

A module resolver only resolves the RantProgram that the final module object is loaded from. This is designed as such to ensure that module loading is limited to the maximum call stack size of the requesting program.

Required Methods§

Source

fn try_resolve( &self, context: &mut Rant, module_path: &str, dependant: Option<&RantProgramInfo>, ) -> ModuleResolveResult

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§