Trait Plugin

Source
pub trait Plugin<T>:
    Sync
    + Send
    + 'static {
    // Required method
    fn handle_message(&mut self, message: Message<T>) -> Option<u8>;
}
Expand description

In this architectures, plugins are purely slaves: they simply react to messages. Their only way of returning information by default is by returning Some(status) to signal that they wish to be dropped. If you want your plugin to be able to communicate back to your application after some of your messages, you should hand them a channel to do so through your message type.

Required Methods§

Source

fn handle_message(&mut self, message: Message<T>) -> Option<u8>

Implementors§

Source§

impl<T: 'static, B: AsMut<dyn Plugin<T>> + Sync + Send + 'static> Plugin<T> for B