[][src]Trait bot_rs_core::plugin::StreamablePlugin

pub trait StreamablePlugin: Send + Sync + Debug {
#[must_use]    fn stream<'life0, 'async_trait>(
        &'life0 self,
        input: UnboundedReceiver<Message>,
        output: UnboundedSender<Vec<Message>>
    ) -> Pin<Box<dyn Future<Output = Result<(), PluginError>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
fn info(&self) -> PluginInfo; }

Allows users to create an asynchronously running stream. This allows commands to send messages to the output without the need of a command invocation.

Required methods

#[must_use]fn stream<'life0, 'async_trait>(
    &'life0 self,
    input: UnboundedReceiver<Message>,
    output: UnboundedSender<Vec<Message>>
) -> Pin<Box<dyn Future<Output = Result<(), PluginError>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 

Create a new Stream sending messages into output and receiving messages to the returned sender.

Must return only if the whole stream was processed or an error occurred.

Should only return PluginError if the execution of the plugin can't be continued.w

fn info(&self) -> PluginInfo

Loading content...

Implementors

Loading content...