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 { ... }
fn on_websocket_frame<'life0, 'async_trait>(
&'life0 self,
_event: WebSocketFrameEvent,
) -> 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§
Sourcefn 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_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
Sourcefn 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_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
Sourcefn 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_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
Sourcefn 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_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
Sourcefn 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,
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
Sourcefn on_websocket_frame<'life0, 'async_trait>(
&'life0 self,
_event: WebSocketFrameEvent,
) -> Pin<Box<dyn Future<Output = AgentResponse> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_websocket_frame<'life0, 'async_trait>(
&'life0 self,
_event: WebSocketFrameEvent,
) -> Pin<Box<dyn Future<Output = AgentResponse> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle a WebSocket frame event
Called for each WebSocket frame when inspection is enabled.
Return AgentResponse::websocket_allow() to forward the frame,
AgentResponse::websocket_drop() to silently drop it, or
AgentResponse::websocket_close(code, reason) to close the connection.