pub trait ModuleResolver: SendSync {
// Required method
fn resolve(
&self,
engine: &Engine,
source: Option<&str>,
path: &str,
pos: Position,
) -> Result<Shared<Module>, Box<EvalAltResult>>;
// Provided methods
fn resolve_raw(
&self,
engine: &Engine,
global: &mut GlobalRuntimeState,
scope: &mut Scope<'_>,
path: &str,
pos: Position,
) -> Result<Shared<Module>, Box<EvalAltResult>> { ... }
fn resolve_ast(
&self,
engine: &Engine,
source: Option<&str>,
path: &str,
pos: Position,
) -> Option<Result<AST, Box<EvalAltResult>>> { ... }
}
Expand description
Trait that encapsulates a module resolution service.
Required Methods§
Provided Methods§
Sourcefn resolve_raw(
&self,
engine: &Engine,
global: &mut GlobalRuntimeState,
scope: &mut Scope<'_>,
path: &str,
pos: Position,
) -> Result<Shared<Module>, Box<EvalAltResult>>
fn resolve_raw( &self, engine: &Engine, global: &mut GlobalRuntimeState, scope: &mut Scope<'_>, path: &str, pos: Position, ) -> Result<Shared<Module>, Box<EvalAltResult>>
Resolve a module based on a path string, given a GlobalRuntimeState
and the current Scope
.
§WARNING - Low Level API
This function is very low level.