Trait ockam_core::Worker[][src]

pub trait Worker: Send + 'static {
    type Message: Message;
    type Context: Send + 'static;
    fn initialize<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        _context: &'life1 mut Self::Context
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... }
fn shutdown<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        _context: &'life1 mut Self::Context
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... }
fn handle_message<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        _context: &'life1 mut Self::Context,
        _msg: Routed<Self::Message>
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... } }
Expand description

Base ockam worker trait.

Associated Types

The type of Message the Worker is sent in Self::handle_message

The API and other resources available for the worker during message processing.

Provided methods

Override initialisation behaviour

Override shutdown behaviour

Try to open and handle a typed message

Implementors