pub struct LoadedPlugin {
pub manifest: NodeManifest,
pub shader_source: String,
pub embedded_textures: Vec<DecodedTexture>,
}Expand description
A loaded WASM plugin with extracted metadata
This is the output of PluginLoader::load() and the input to
GlitchEngine::register_plugin(). It contains everything needed
to create GPU resources for the plugin.
§Usage
ⓘ
// In glitcher-loader
let loaded = loader.load(&wasm_bytes)?;
// In glitcher-engine
let node_id = engine.register_plugin(&loaded)?;Fields§
§manifest: NodeManifestNode manifest from get-manifest() WIT function
shader_source: StringWGSL shader source from get-shader-source() WIT function
embedded_textures: Vec<DecodedTexture>Decoded embedded textures (ready for GPU upload)
Implementations§
Source§impl LoadedPlugin
impl LoadedPlugin
Sourcepub fn new(
manifest: NodeManifest,
shader_source: String,
embedded_textures: Vec<DecodedTexture>,
) -> Self
pub fn new( manifest: NodeManifest, shader_source: String, embedded_textures: Vec<DecodedTexture>, ) -> Self
Create a new loaded plugin
Sourcepub fn display_name(&self) -> &str
pub fn display_name(&self) -> &str
Get the display name from manifest
Sourcepub fn has_embedded_textures(&self) -> bool
pub fn has_embedded_textures(&self) -> bool
Check if this plugin has embedded textures
Trait Implementations§
Source§impl Clone for LoadedPlugin
impl Clone for LoadedPlugin
Source§fn clone(&self) -> LoadedPlugin
fn clone(&self) -> LoadedPlugin
Returns a duplicate 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 moreAuto Trait Implementations§
impl Freeze for LoadedPlugin
impl RefUnwindSafe for LoadedPlugin
impl Send for LoadedPlugin
impl Sync for LoadedPlugin
impl Unpin for LoadedPlugin
impl UnwindSafe for LoadedPlugin
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