Skip to main content

Module

Trait Module 

Source
pub trait Module: Send {
    // Required methods
    fn id(&self) -> &str;
    fn stop(&mut self);

    // Provided methods
    fn handle(&self) -> Option<ActorRef<CommandEnum>> { ... }
    fn set_enabled(&mut self, _enabled: bool) { ... }
}
Expand description

Unified interface for sensor and control modules (MIDI hubs, OSC servers, etc.).

Required Methods§

Source

fn id(&self) -> &str

Returns this module’s unique identifier.

Source

fn stop(&mut self)

Stops the module, joining any background threads.

Provided Methods§

Source

fn handle(&self) -> Option<ActorRef<CommandEnum>>

Returns the actor handle if this module has a control actor, None otherwise.

Source

fn set_enabled(&mut self, _enabled: bool)

Enables or disables the module.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§