Trait streamduck_core::modules::SDModule
source · [−]pub trait SDModule: Send + Sync {
fn name(&self) -> String;
fn components(&self) -> HashMap<String, ComponentDefinition>;
fn add_component(&self, button: &mut Button, name: &str);
fn listening_for(&self) -> Vec<String>;
fn event(&self, core: CoreHandle, event: SDEvent);
fn settings(&self) -> Vec<UIValue> { ... }
fn set_setting(&self, value: UIValue) { ... }
fn metadata(&self) -> PluginMetadata { ... }
}
Expand description
Module trait
Required methods
fn components(&self) -> HashMap<String, ComponentDefinition>
fn components(&self) -> HashMap<String, ComponentDefinition>
Definition for components that module will be providing
fn add_component(&self, button: &mut Button, name: &str)
fn add_component(&self, button: &mut Button, name: &str)
Method for adding components onto buttons
fn listening_for(&self) -> Vec<String>
fn listening_for(&self) -> Vec<String>
Specifies which components the module will be receiving events for
fn event(&self, core: CoreHandle, event: SDEvent)
fn event(&self, core: CoreHandle, event: SDEvent)
Method for handling core events, add EVENTS feature to the plugin metadata to receive events
Provided methods
fn set_setting(&self, value: UIValue)
fn set_setting(&self, value: UIValue)
Method for updating plugin settings from UI
fn metadata(&self) -> PluginMetadata
fn metadata(&self) -> PluginMetadata
Metadata of the module, auto-implemented for plugins from plugin metadata