Trait fluxion::message::inverted::InvertedHandler
source · pub trait InvertedHandler<C: FluxionParams, A: Actor<C>>: Send + Sync {
// Required methods
fn handle<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
context: &'life1 ActorContext<C>,
actor: &'life2 A
) -> Pin<Box<dyn Future<Output = Result<(), ActorError<A::Error>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn sender(&self) -> Option<ActorId>;
}
Expand description
InvertedHandler
Enables the handle
function to be called on struct wrapping a message, removing the requirement
of knowing the message’s type.
Required Methods§
sourcefn handle<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
context: &'life1 ActorContext<C>,
actor: &'life2 A
) -> Pin<Box<dyn Future<Output = Result<(), ActorError<A::Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn handle<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, context: &'life1 ActorContext<C>, actor: &'life2 A ) -> Pin<Box<dyn Future<Output = Result<(), ActorError<A::Error>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,
Removes the requirement of knowing a message’s type by having the message dispatch itself (using a trait) to an actor with a given context.