Skip to main content

ScriptSource

Trait ScriptSource 

Source
pub trait ScriptSource {
    // Required methods
    fn module_ids(&self) -> Vec<ModuleId>;
    fn load(&self, id: &ModuleId) -> Result<ScriptAsset, ScriptSourceError>;
}

Required Methods§

Source

fn module_ids(&self) -> Vec<ModuleId>

Source

fn load(&self, id: &ModuleId) -> Result<ScriptAsset, ScriptSourceError>

Load one declared module.

§Errors

Returns ScriptSourceError when the module is absent, escapes a file root, or cannot be read.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§