Skip to main content

Module plugin

Module plugin 

Source
Expand description

Plugin system for embedded WASM viewer plugins GLDF Plugin System

This module provides support for viewer plugins embedded in GLDF files. Plugins are WASM modules stored in other/viewer/<plugin-type>/ directories with a manifest.json describing their capabilities.

§Plugin Structure in GLDF

myfile.gldf (ZIP archive)
└── other/
    └── viewer/
        └── starsky/                    # Plugin directory
            ├── manifest.json           # Plugin metadata
            ├── plugin.js               # WASM JS bindings
            └── plugin_bg.wasm          # WASM binary

§Example

use gldf_rs::plugin::{PluginManager, PluginManifest};

let gldf = FileBufGldf::load("luminaire.gldf")?;
let plugins = PluginManager::discover_plugins(&gldf);

for plugin in plugins {
    println!("Found plugin: {} ({})", plugin.manifest.name, plugin.manifest.plugin_type);
}

Structs§

Plugin
A discovered plugin with its manifest and file contents.
PluginManager
Plugin discovery and management for GLDF files.
PluginManifest
Plugin manifest describing a viewer plugin embedded in a GLDF file.
StorageKeys
Storage keys for plugins that need multiple data files