Trait ockam_core::Worker[][src]

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

Notable traits for Pin<P>

impl<P> Future for Pin<P> where
    P: Unpin + DerefMut,
    <P as Deref>::Target: Future
type Output = <<P as Deref>::Target as Future>::Output;

    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... }
fn shutdown(&mut self, _context: &mut Self::Context) -> Result<()> { ... }
#[must_use] 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>>

Notable traits for Pin<P>

impl<P> Future for Pin<P> where
    P: Unpin + DerefMut,
    <P as Deref>::Target: Future
type Output = <<P as Deref>::Target as Future>::Output;

    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: Send + 'static[src]

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

Loading content...

Provided methods

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

Notable traits for Pin<P>

impl<P> Future for Pin<P> where
    P: Unpin + DerefMut,
    <P as Deref>::Target: Future
type Output = <<P as Deref>::Target as Future>::Output;
where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Override initialisation behaviour

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

Override shutdown behaviour

#[must_use]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>>

Notable traits for Pin<P>

impl<P> Future for Pin<P> where
    P: Unpin + DerefMut,
    <P as Deref>::Target: Future
type Output = <<P as Deref>::Target as Future>::Output;
where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Try to open and handle a typed message

Loading content...

Implementors

Loading content...