adlt::plugins::plugin

Trait Plugin

Source
pub trait Plugin {
    // Required methods
    fn name(&self) -> &str;
    fn enabled(&self) -> bool;
    fn state(&self) -> Arc<RwLock<PluginState>>;
    fn process_msg(&mut self, msg: &mut DltMessage) -> bool;
}

Required Methods§

Source

fn name(&self) -> &str

Source

fn enabled(&self) -> bool

Source

fn state(&self) -> Arc<RwLock<PluginState>>

Source

fn process_msg(&mut self, msg: &mut DltMessage) -> bool

process a single msg this can modify the msg (and is expected for most plugins)

a plugin can modify e.g.

  • msg.timestamp_dms
  • msg.reception_time_us
  • payload: msg.set_payload_text(…)

returns false if the msg should be droppped (i.e. not forwarded) and true in all other cases

Trait Implementations§

Source§

impl Debug for dyn Plugin + Send

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Implementors§