pub trait Worker: 'static + Send {
type Message: Message;
type Context: 'static + Send;
fn initialize<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_context: &'life1 mut Self::Context
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>>ⓘNotable traits for Pin<P>impl<P> Future for Pin<P> where
P: 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<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_context: &'life1 mut Self::Context
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>>ⓘNotable traits for Pin<P>impl<P> Future for Pin<P> where
P: 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 handle_message<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_context: &'life1 mut Self::Context,
_msg: Routed<Self::Message>
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>>ⓘNotable traits for Pin<P>impl<P> Future for Pin<P> where
P: 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,
{ ... }
}
Expand description
Base ockam worker trait.
Associated Types
The type of Message the Worker is sent in Self::handle_message
Provided methods
fn initialize<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_context: &'life1 mut Self::Context
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>>ⓘNotable traits for Pin<P>impl<P> Future for Pin<P> where
P: 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 initialize<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_context: &'life1 mut Self::Context
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>>ⓘNotable traits for Pin<P>impl<P> Future for Pin<P> where
P: 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,
P: DerefMut,
<P as Deref>::Target: Future, type Output = <<P as Deref>::Target as Future>::Output;
Override initialisation behaviour
fn shutdown<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_context: &'life1 mut Self::Context
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>>ⓘNotable traits for Pin<P>impl<P> Future for Pin<P> where
P: 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<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_context: &'life1 mut Self::Context
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>>ⓘNotable traits for Pin<P>impl<P> Future for Pin<P> where
P: 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,
P: DerefMut,
<P as Deref>::Target: Future, type Output = <<P as Deref>::Target as Future>::Output;
Override shutdown behaviour
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<(), Error>> + Send + 'async_trait, Global>>ⓘNotable traits for Pin<P>impl<P> Future for Pin<P> where
P: 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 handle_message<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_context: &'life1 mut Self::Context,
_msg: Routed<Self::Message>
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>>ⓘNotable traits for Pin<P>impl<P> Future for Pin<P> where
P: 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,
P: DerefMut,
<P as Deref>::Target: Future, type Output = <<P as Deref>::Target as Future>::Output;
Try to open and handle a typed message
Implementations on Foreign Types
sourceimpl<V, N> Worker for SecureChannelListener<V, N> where
V: SecureChannelVault,
N: SecureChannelNewKeyExchanger,
impl<V, N> Worker for SecureChannelListener<V, N> where
V: SecureChannelVault,
N: SecureChannelNewKeyExchanger,
type Message = CreateResponderChannelMessage
type Context = Context
fn handle_message<'life0, 'life1, 'async_trait>(
&'life0 mut self,
ctx: &'life1 mut <SecureChannelListener<V, N> as Worker>::Context,
msg: Routed<<SecureChannelListener<V, N> as Worker>::Message>
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>>ⓘNotable traits for Pin<P>impl<P> Future for Pin<P> where
P: DerefMut,
<P as Deref>::Target: Future, type Output = <<P as Deref>::Target as Future>::Output;
where
'life0: 'async_trait,
'life1: 'async_trait,
SecureChannelListener<V, N>: 'async_trait,
P: DerefMut,
<P as Deref>::Target: Future, type Output = <<P as Deref>::Target as Future>::Output;
sourceimpl<V, K> Worker for SecureChannelWorker<V, K> where
V: SecureChannelVault,
K: SecureChannelKeyExchanger,
impl<V, K> Worker for SecureChannelWorker<V, K> where
V: SecureChannelVault,
K: SecureChannelKeyExchanger,
type Message = Any
type Context = Context
fn initialize<'life0, 'life1, 'async_trait>(
&'life0 mut self,
ctx: &'life1 mut <SecureChannelWorker<V, K> as Worker>::Context
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>>ⓘNotable traits for Pin<P>impl<P> Future for Pin<P> where
P: DerefMut,
<P as Deref>::Target: Future, type Output = <<P as Deref>::Target as Future>::Output;
where
'life0: 'async_trait,
'life1: 'async_trait,
SecureChannelWorker<V, K>: 'async_trait,
P: DerefMut,
<P as Deref>::Target: Future, type Output = <<P as Deref>::Target as Future>::Output;
fn handle_message<'life0, 'life1, 'async_trait>(
&'life0 mut self,
ctx: &'life1 mut <SecureChannelWorker<V, K> as Worker>::Context,
msg: Routed<<SecureChannelWorker<V, K> as Worker>::Message>
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>>ⓘNotable traits for Pin<P>impl<P> Future for Pin<P> where
P: DerefMut,
<P as Deref>::Target: Future, type Output = <<P as Deref>::Target as Future>::Output;
where
'life0: 'async_trait,
'life1: 'async_trait,
SecureChannelWorker<V, K>: 'async_trait,
P: DerefMut,
<P as Deref>::Target: Future, type Output = <<P as Deref>::Target as Future>::Output;