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§
Sourcefn components(&self) -> HashMap<String, ComponentDefinition>
fn components(&self) -> HashMap<String, ComponentDefinition>
Definition for components that module will be providing
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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 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
Sourcefn listening_for(&self) -> Vec<String>
fn listening_for(&self) -> Vec<String>
Specifies which components the module will be receiving events for
Provided Methods§
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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<'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
Sourcefn render_hash(
&self,
core: CoreHandle,
button: &UniqueButton,
hash: &mut Box<dyn Hasher>,
)
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
Sourcefn metadata(&self) -> PluginMetadata
fn metadata(&self) -> PluginMetadata
Metadata of the module, auto-implemented for plugins from plugin metadata