SDModule

Trait SDModule 

Source
pub trait SDModule: Send + Sync {
Show 15 methods // Required methods fn name(&self) -> String; fn components(&self) -> HashMap<String, ComponentDefinition>; fn add_component<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, core: CoreHandle, button: &'life1 mut Button, name: &'life2 str, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn remove_component<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, core: CoreHandle, button: &'life1 mut Button, name: &'life2 str, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn paste_component<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, core: CoreHandle, reference_button: &'life1 Button, new_button: &'life2 mut Button, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn component_values<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, core: CoreHandle, button: &'life1 Button, name: &'life2 str, ) -> Pin<Box<dyn Future<Output = Vec<UIValue>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn set_component_value<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, core: CoreHandle, button: &'life1 mut Button, name: &'life2 str, value: Vec<UIValue>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn listening_for(&self) -> Vec<String>; // Provided methods fn settings<'life0, 'async_trait>( &'life0 self, core_manager: Arc<CoreManager>, ) -> Pin<Box<dyn Future<Output = Vec<UIValue>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn set_setting<'life0, 'async_trait>( &'life0 self, core_manager: Arc<CoreManager>, value: Vec<UIValue>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn global_event<'life0, 'async_trait>( &'life0 self, event: SDGlobalEvent, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn event<'life0, 'async_trait>( &'life0 self, core: CoreHandle, event: SDCoreEvent, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn render<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, core: CoreHandle, button: &'life1 UniqueButton, frame: &'life2 mut DynamicImage, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn render_hash( &self, core: CoreHandle, button: &UniqueButton, hash: &mut Box<dyn Hasher>, ) { ... } fn metadata(&self) -> PluginMetadata { ... }
}
Expand description

Module trait

Required Methods§

Source

fn name(&self) -> String

Module name

Source

fn components(&self) -> HashMap<String, ComponentDefinition>

Definition for components that module will be providing

Source

fn add_component<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, core: CoreHandle, button: &'life1 mut Button, name: &'life2 str, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Method for adding components onto buttons

Source

fn remove_component<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, core: CoreHandle, button: &'life1 mut Button, name: &'life2 str, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Method for removing components from buttons

Source

fn paste_component<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, core: CoreHandle, reference_button: &'life1 Button, new_button: &'life2 mut Button, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Method for handling pasting components of plugin, can be used for any additional handling

Source

fn component_values<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, core: CoreHandle, button: &'life1 Button, name: &'life2 str, ) -> Pin<Box<dyn Future<Output = Vec<UIValue>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Method for letting core know what values component currently has

Source

fn set_component_value<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, core: CoreHandle, button: &'life1 mut Button, name: &'life2 str, value: Vec<UIValue>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Method for setting values on components

Source

fn listening_for(&self) -> Vec<String>

Specifies which components the module will be receiving events for

Provided Methods§

Source

fn settings<'life0, 'async_trait>( &'life0 self, core_manager: Arc<CoreManager>, ) -> Pin<Box<dyn Future<Output = Vec<UIValue>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Current settings state of the plugin

Source

fn set_setting<'life0, 'async_trait>( &'life0 self, core_manager: Arc<CoreManager>, value: Vec<UIValue>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Method for updating plugin settings from UI

Source

fn global_event<'life0, 'async_trait>( &'life0 self, event: SDGlobalEvent, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Method for handling global events, add GLOBAL_EVENTS feature to the plugin metadata to receive global events

Source

fn event<'life0, 'async_trait>( &'life0 self, core: CoreHandle, event: SDCoreEvent, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Method for handling core events, add CORE_EVENTS feature to the plugin metadata to receive core events

Source

fn render<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, core: CoreHandle, button: &'life1 UniqueButton, frame: &'life2 mut DynamicImage, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Method renderer will run for rendering additional information on a button if RENDERING feature was specified

Source

fn render_hash( &self, core: CoreHandle, button: &UniqueButton, hash: &mut Box<dyn Hasher>, )

Method for telling renderer if anything changed

Changing state of the hash in anyway will cause renderer to either rerender, or use previous cache. This method will also called very frequently, so keep code in here fast

Source

fn metadata(&self) -> PluginMetadata

Metadata of the module, auto-implemented for plugins from plugin metadata

Implementors§