Trait ModuleScriptLoader

Source
pub trait ModuleScriptLoader {
    // Required method
    fn load_script(&mut self, name: String) -> Option<String>;
}
Expand description

Enables one to enable module loading for Wren

Required Methods§

Source

fn load_script(&mut self, name: String) -> Option<String>

Takes a desired module name

§Returns
  • Some(String) containing the Wren source if the module exists
  • None if not

Implementors§

Source§

impl ModuleScriptLoader for BasicFileLoader

Enable to load wren scripts from a base directory

Source§

impl ModuleScriptLoader for NullLoader

Source§

impl<T> ModuleScriptLoader for T
where T: FnMut(String) -> Option<String>,