AgentMessageHandler

Trait AgentMessageHandler 

Source
pub trait AgentMessageHandler: Send + Sync {
    // Provided methods
    fn handle_agent_register<'life0, 'async_trait>(
        &'life0 self,
        ctx: HandlerContext,
    ) -> Pin<Box<dyn Future<Output = HandlerResult> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn handle_agent_discover<'life0, 'async_trait>(
        &'life0 self,
        ctx: HandlerContext,
    ) -> Pin<Box<dyn Future<Output = HandlerResult> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn handle_agent_heartbeat<'life0, 'async_trait>(
        &'life0 self,
        ctx: HandlerContext,
    ) -> Pin<Box<dyn Future<Output = HandlerResult> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn handle_call<'life0, 'async_trait>(
        &'life0 self,
        ctx: HandlerContext,
    ) -> Pin<Box<dyn Future<Output = HandlerResult> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn handle_response<'life0, 'async_trait>(
        &'life0 self,
        ctx: HandlerContext,
    ) -> Pin<Box<dyn Future<Output = HandlerResult> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn handle_event<'life0, 'async_trait>(
        &'life0 self,
        ctx: HandlerContext,
    ) -> Pin<Box<dyn Future<Output = HandlerResult> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn handle_stream_open<'life0, 'async_trait>(
        &'life0 self,
        ctx: HandlerContext,
    ) -> Pin<Box<dyn Future<Output = HandlerResult> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn handle_stream_chunk<'life0, 'async_trait>(
        &'life0 self,
        ctx: HandlerContext,
    ) -> Pin<Box<dyn Future<Output = HandlerResult> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn handle_stream_close<'life0, 'async_trait>(
        &'life0 self,
        ctx: HandlerContext,
    ) -> Pin<Box<dyn Future<Output = HandlerResult> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn handle_ack<'life0, 'async_trait>(
        &'life0 self,
        ctx: HandlerContext,
    ) -> Pin<Box<dyn Future<Output = HandlerResult> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn handle_error<'life0, 'async_trait>(
        &'life0 self,
        ctx: HandlerContext,
    ) -> Pin<Box<dyn Future<Output = HandlerResult> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn handle_unhandled<'life0, 'async_trait>(
        &'life0 self,
        ctx: HandlerContext,
        message_type: MessageType,
    ) -> Pin<Box<dyn Future<Output = HandlerResult> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

Trait implemented by agent-specific MXP message handlers.

Provided Methods§

Source

fn handle_agent_register<'life0, 'async_trait>( &'life0 self, ctx: HandlerContext, ) -> Pin<Box<dyn Future<Output = HandlerResult> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called for AgentRegister messages.

Source

fn handle_agent_discover<'life0, 'async_trait>( &'life0 self, ctx: HandlerContext, ) -> Pin<Box<dyn Future<Output = HandlerResult> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called for AgentDiscover messages.

Source

fn handle_agent_heartbeat<'life0, 'async_trait>( &'life0 self, ctx: HandlerContext, ) -> Pin<Box<dyn Future<Output = HandlerResult> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called for AgentHeartbeat messages.

Source

fn handle_call<'life0, 'async_trait>( &'life0 self, ctx: HandlerContext, ) -> Pin<Box<dyn Future<Output = HandlerResult> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called for Call messages.

Source

fn handle_response<'life0, 'async_trait>( &'life0 self, ctx: HandlerContext, ) -> Pin<Box<dyn Future<Output = HandlerResult> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called for Response messages.

Source

fn handle_event<'life0, 'async_trait>( &'life0 self, ctx: HandlerContext, ) -> Pin<Box<dyn Future<Output = HandlerResult> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called for Event messages.

Source

fn handle_stream_open<'life0, 'async_trait>( &'life0 self, ctx: HandlerContext, ) -> Pin<Box<dyn Future<Output = HandlerResult> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called for StreamOpen messages.

Source

fn handle_stream_chunk<'life0, 'async_trait>( &'life0 self, ctx: HandlerContext, ) -> Pin<Box<dyn Future<Output = HandlerResult> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called for StreamChunk messages.

Source

fn handle_stream_close<'life0, 'async_trait>( &'life0 self, ctx: HandlerContext, ) -> Pin<Box<dyn Future<Output = HandlerResult> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called for StreamClose messages.

Source

fn handle_ack<'life0, 'async_trait>( &'life0 self, ctx: HandlerContext, ) -> Pin<Box<dyn Future<Output = HandlerResult> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called for Ack messages.

Source

fn handle_error<'life0, 'async_trait>( &'life0 self, ctx: HandlerContext, ) -> Pin<Box<dyn Future<Output = HandlerResult> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called for protocol-level error responses.

Source

fn handle_unhandled<'life0, 'async_trait>( &'life0 self, ctx: HandlerContext, message_type: MessageType, ) -> Pin<Box<dyn Future<Output = HandlerResult> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fallback invoked when a specialized handler is not implemented.

Implementors§