pub trait CallInterceptor: Send + Sync {
// Provided methods
fn before<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
method: &'life1 str,
params: &'life2 mut ServiceParams,
) -> Pin<Box<dyn Future<Output = Result<(), A2AError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn after<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
method: &'life1 str,
result: &'life2 Result<(), A2AError>,
) -> Pin<Box<dyn Future<Output = Result<(), A2AError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
}Expand description
Interceptor for modifying requests and responses at the client level.
Interceptors are called in order for before, and in reverse order for after.
Provided Methods§
Sourcefn before<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
method: &'life1 str,
params: &'life2 mut ServiceParams,
) -> Pin<Box<dyn Future<Output = Result<(), A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn before<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
method: &'life1 str,
params: &'life2 mut ServiceParams,
) -> Pin<Box<dyn Future<Output = Result<(), A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Called before sending a request. Can modify params (e.g., add auth headers).
Sourcefn after<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
method: &'life1 str,
result: &'life2 Result<(), A2AError>,
) -> Pin<Box<dyn Future<Output = Result<(), A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn after<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
method: &'life1 str,
result: &'life2 Result<(), A2AError>,
) -> Pin<Box<dyn Future<Output = Result<(), A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Called after receiving a response.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".