Skip to main content

Dispatcher

Trait Dispatcher 

Source
pub trait Dispatcher:
    Send
    + Sync
    + 'static {
    // Required method
    fn dispatch(
        &self,
        req: Request<Incoming>,
    ) -> Pin<Box<dyn Future<Output = DispatchResponse> + Send + '_>>;
}
Expand description

Trait for types that can dispatch HTTP requests to an A2A handler.

Implemented by both JsonRpcDispatcher and RestDispatcher.

Required Methods§

Source

fn dispatch( &self, req: Request<Incoming>, ) -> Pin<Box<dyn Future<Output = DispatchResponse> + Send + '_>>

Dispatches an HTTP request and returns a response.

Implementors§