SparkGenericModuleHandler

Trait SparkGenericModuleHandler 

Source
pub trait SparkGenericModuleHandler<Message, Response, Error = Error> {
    // Required methods
    fn handle_request<'life0, 'async_trait>(
        &'life0 mut self,
        request: Message,
    ) -> Pin<Box<dyn Future<Output = Result<Response, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn handle_command<'life0, 'async_trait>(
        &'life0 mut self,
        command: Message,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

A trait for handling module requests and commands.

Required Methods§

Source

fn handle_request<'life0, 'async_trait>( &'life0 mut self, request: Message, ) -> Pin<Box<dyn Future<Output = Result<Response, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Handle a request, potentially returning an error.

Source

fn handle_command<'life0, 'async_trait>( &'life0 mut self, command: Message, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Handle a command, potentially returning an error.

Implementors§