Create module from file.

This commit is contained in:
Stephen Chung 2020-05-06 22:26:52 +08:00
parent d75a8bc6cd
commit 59eaad1fdf

View File

@ -740,6 +740,15 @@ mod file {
pub fn new() -> Self {
Default::default()
}
/// Create a `Module` from a file path.
pub fn create_module<P: Into<PathBuf>>(
&self,
engine: &Engine,
path: &str,
) -> Result<Module, Box<EvalAltResult>> {
self.resolve(engine, path, Default::default())
}
}
impl ModuleResolver for FileModuleResolver {