pub trait Module {
type Config: DeserializeOwned;
// Required method
fn init(info: &InitInfo, config: Self::Config) -> Self;
// Provided methods
fn update(&mut self) { ... }
fn refresh(&mut self, signal: i32) { ... }
fn do_action(&mut self, action: &str) { ... }
}Expand description
A Waybar CFFI module.
In most cases, only Module::init needs to be specified, and the default
implementations of the other methods can be used unchanged.
Required Associated Types§
Sourcetype Config: DeserializeOwned
type Config: DeserializeOwned
The configuration type.
The JSONC configuration for the module will be deserialised using
serde into a value of this type.
Required Methods§
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.