pub struct ModuleLoader { /* private fields */ }Expand description
Helper for loading, compiling, and caching Koto modules
Implementations§
Source§impl ModuleLoader
impl ModuleLoader
Sourcepub fn compile_script(
&mut self,
script: &str,
script_path: Option<KString>,
settings: CompilerSettings,
) -> Result<Ptr<Chunk>, ModuleLoaderError>
pub fn compile_script( &mut self, script: &str, script_path: Option<KString>, settings: CompilerSettings, ) -> Result<Ptr<Chunk>, ModuleLoaderError>
Compiles a script, deferring to Compiler::compile
Sourcepub fn compile_module(
&mut self,
module_name: &str,
current_script_path: Option<&Path>,
) -> Result<CompileModuleResult, ModuleLoaderError>
pub fn compile_module( &mut self, module_name: &str, current_script_path: Option<&Path>, ) -> Result<CompileModuleResult, ModuleLoaderError>
Finds a module from its name, and then compiles it
Sourcepub fn clear_cache(&mut self)
pub fn clear_cache(&mut self)
Clears the compiled module cache
Trait Implementations§
Source§impl Clone for ModuleLoader
impl Clone for ModuleLoader
Source§fn clone(&self) -> ModuleLoader
fn clone(&self) -> ModuleLoader
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for ModuleLoader
impl Default for ModuleLoader
Source§fn default() -> ModuleLoader
fn default() -> ModuleLoader
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ModuleLoader
impl RefUnwindSafe for ModuleLoader
impl !Send for ModuleLoader
impl !Sync for ModuleLoader
impl Unpin for ModuleLoader
impl UnwindSafe for ModuleLoader
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