pub trait ClientHooks<Inner = ()>where
Self: ClientInfo<Inner>,{
// Provided methods
async fn pre<E>(
&self,
request: &mut Request,
info: &OperationInfo,
) -> Result<(), Error<E>> { ... }
async fn post<E>(
&self,
result: &Result<Response>,
info: &OperationInfo,
) -> Result<(), Error<E>> { ... }
async fn exec(
&self,
request: Request,
info: &OperationInfo,
) -> Result<Response> { ... }
}Expand description
Interface for changing the behavior of generated clients. All clients
implement this for &Client; to override the default behavior, implement
some or all of the interfaces for the Client type (without the
reference). This mechanism relies on so-called “auto-ref specialization”.
Provided Methods§
Sourceasync fn pre<E>(
&self,
request: &mut Request,
info: &OperationInfo,
) -> Result<(), Error<E>>
async fn pre<E>( &self, request: &mut Request, info: &OperationInfo, ) -> Result<(), Error<E>>
Runs prior to the execution of the request. This may be used to modify the request before it is transmitted.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.