pub struct FileModuleLoader { /* private fields */ }
Expand description
Loads modules from source files and compiled bytecode files.
Implementations§
Source§impl FileModuleLoader
impl FileModuleLoader
Sourcepub fn new() -> FileModuleLoader
pub fn new() -> FileModuleLoader
Creates a new FileModuleLoader
that will search the current
directory for modules.
Sourcepub fn with_search_paths(paths: Vec<PathBuf>) -> FileModuleLoader
pub fn with_search_paths(paths: Vec<PathBuf>) -> FileModuleLoader
Creates a new FileModuleLoader
that will search the given series
of directories to load modules.
Sourcepub fn add_search_path(&mut self, path: PathBuf)
pub fn add_search_path(&mut self, path: PathBuf)
Adds a directory to search for module files.
Sourcepub fn set_read_bytecode(&mut self, set: bool)
pub fn set_read_bytecode(&mut self, set: bool)
Sets whether the FileModuleLoader
will search for compiled bytecode
files when loading modules. The default is true
.
Sourcepub fn set_write_bytecode(&mut self, set: bool)
pub fn set_write_bytecode(&mut self, set: bool)
Sets whether the FileModuleLoader
will write compiled bytecode
files after loading a module from source. The default is true
.
Trait Implementations§
Source§impl ModuleLoader for FileModuleLoader
impl ModuleLoader for FileModuleLoader
Source§fn load_module(&self, name: Name, ctx: Context) -> Result<Module, Error>
fn load_module(&self, name: Name, ctx: Context) -> Result<Module, Error>
Loads the named module, supplying a new execution context. Read more
Source§fn chain<T: ModuleLoader>(self, second: T) -> ChainModuleLoader<Self, T>where
Self: Sized,
fn chain<T: ModuleLoader>(self, second: T) -> ChainModuleLoader<Self, T>where
Self: Sized,
Creates a
ChainModuleLoader
using this loader and another. Read moreAuto Trait Implementations§
impl !Freeze for FileModuleLoader
impl !RefUnwindSafe for FileModuleLoader
impl Send for FileModuleLoader
impl !Sync for FileModuleLoader
impl Unpin for FileModuleLoader
impl UnwindSafe for FileModuleLoader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more