Trait ockam::Worker[][src]

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

Base ockam worker trait.

Associated Types

type Message: Message[src]

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

type Context: 'static + Send[src]

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

Loading content...

Provided methods

#[must_use]pub fn initialize<'life0, 'life1, 'async_trait>(
    &'life0 mut self,
    _context: &'life1 mut Self::Context
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait + Send, Global>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Override initialisation behaviour

pub fn shutdown(&mut self, _context: &mut Self::Context) -> Result<(), Error>[src]

Override shutdown behaviour

#[must_use]pub fn handle_message<'life0, 'life1, 'async_trait>(
    &'life0 mut self,
    _context: &'life1 mut Self::Context,
    _msg: Self::Message
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait + Send, Global>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Try to open and handle a typed message

Loading content...

Implementors

Loading content...