AgentHandler

Trait AgentHandler 

Source
pub trait AgentHandler: Send + Sync {
    // Provided methods
    fn on_request_headers<'life0, 'async_trait>(
        &'life0 self,
        _event: RequestHeadersEvent,
    ) -> Pin<Box<dyn Future<Output = AgentResponse> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn on_request_body_chunk<'life0, 'async_trait>(
        &'life0 self,
        _event: RequestBodyChunkEvent,
    ) -> Pin<Box<dyn Future<Output = AgentResponse> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn on_response_headers<'life0, 'async_trait>(
        &'life0 self,
        _event: ResponseHeadersEvent,
    ) -> Pin<Box<dyn Future<Output = AgentResponse> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn on_response_body_chunk<'life0, 'async_trait>(
        &'life0 self,
        _event: ResponseBodyChunkEvent,
    ) -> Pin<Box<dyn Future<Output = AgentResponse> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn on_request_complete<'life0, 'async_trait>(
        &'life0 self,
        _event: RequestCompleteEvent,
    ) -> Pin<Box<dyn Future<Output = AgentResponse> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

Trait for implementing agent logic

Provided Methods§

Source

fn on_request_headers<'life0, 'async_trait>( &'life0 self, _event: RequestHeadersEvent, ) -> Pin<Box<dyn Future<Output = AgentResponse> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Handle a request headers event

Source

fn on_request_body_chunk<'life0, 'async_trait>( &'life0 self, _event: RequestBodyChunkEvent, ) -> Pin<Box<dyn Future<Output = AgentResponse> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Handle a request body chunk event

Source

fn on_response_headers<'life0, 'async_trait>( &'life0 self, _event: ResponseHeadersEvent, ) -> Pin<Box<dyn Future<Output = AgentResponse> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Handle a response headers event

Source

fn on_response_body_chunk<'life0, 'async_trait>( &'life0 self, _event: ResponseBodyChunkEvent, ) -> Pin<Box<dyn Future<Output = AgentResponse> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Handle a response body chunk event

Source

fn on_request_complete<'life0, 'async_trait>( &'life0 self, _event: RequestCompleteEvent, ) -> Pin<Box<dyn Future<Output = AgentResponse> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Handle a request complete event

Implementors§