Struct FileModuleLoader

Source
pub struct FileModuleLoader { /* private fields */ }
Expand description

Loads modules from source files and compiled bytecode files.

Implementations§

Source§

impl FileModuleLoader

Source

pub fn new() -> FileModuleLoader

Creates a new FileModuleLoader that will search the current directory for modules.

Source

pub fn with_search_paths(paths: Vec<PathBuf>) -> FileModuleLoader

Creates a new FileModuleLoader that will search the given series of directories to load modules.

Source

pub fn add_search_path(&mut self, path: PathBuf)

Adds a directory to search for module files.

Source

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.

Source

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

Source§

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,

Creates a ChainModuleLoader using this loader and another. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V