pub trait Plugin: Sync + Send {
    fn start(
        &self,
        pub_socket: Socket,
        sub_socket: Socket
    ) -> Result<(), EngineError>; fn get_subscriptions(&self) -> Result<Vec<Box<dyn EventType>>, EngineError>; fn get_id(&self) -> Uuid; }
Expand description

Public API for defining the “plugins” or independent components of an application. A plugin is an application component that defines its own event subscriptions and runs as a standalone thread. Both “internal” plugins and “external” plugins are supported. API for internal plugins; i.e., plugins written in Rust and running in the main application process.

Required Methods

the entry point for the plugin. the engine will start the plugin in its own thread and execute this function. the pub_socket is used by the plugin to publish new events. the sub_socket is used by the plugin to get events published by other plugins.

Return the event subscriptions, as a vector of strings, that this plugin is interested in.

Returns the unique id for this plugin

Implementors