Struct koto_bytecode::Loader
source · pub struct Loader { /* private fields */ }Expand description
Helper for loading, compiling, and caching Koto modules
Implementations§
source§impl Loader
impl Loader
sourcepub fn compile_script(
&mut self,
script: &str,
script_path: &Option<PathBuf>,
settings: CompilerSettings
) -> Result<Ptr<Chunk>, LoaderError>
pub fn compile_script( &mut self, script: &str, script_path: &Option<PathBuf>, settings: CompilerSettings ) -> Result<Ptr<Chunk>, LoaderError>
Compiles a script
sourcepub fn compile_module(
&mut self,
name: &str,
load_from_path: Option<PathBuf>
) -> Result<CompileModuleResult, LoaderError>
pub fn compile_module( &mut self, name: &str, load_from_path: Option<PathBuf> ) -> Result<CompileModuleResult, LoaderError>
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§
Auto Trait Implementations§
impl Freeze for Loader
impl RefUnwindSafe for Loader
impl Send for Loader
impl Sync for Loader
impl Unpin for Loader
impl UnwindSafe for Loader
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