Skip to main content

AgentHandler

Trait AgentHandler 

Source
pub trait AgentHandler: Send {
    // Required method
    fn handle(
        &self,
        message: &AgentMessage,
        ctx: &AgentCtx<'_>,
    ) -> impl Future<Output = Result<(), LaserError>> + Send;
}
Expand description

What you implement: one async handle per message. (AgentHandler is the Send variant the runtime drives.)

Required Methods§

Source

fn handle( &self, message: &AgentMessage, ctx: &AgentCtx<'_>, ) -> impl Future<Output = Result<(), LaserError>> + Send

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§