pub trait ResponseHandler: Debug {
type Error: Error;
// Required method
fn handle(&self, res: &Response) -> Result<(), Self::Error>;
}Expand description
A trait for handling request responses.
Required Associated Types§
Required Methods§
Sourcefn handle(&self, res: &Response) -> Result<(), Self::Error>
fn handle(&self, res: &Response) -> Result<(), Self::Error>
Called at the end of each request. Use this method to, for example, log the response body to standard output.
Note: This method should NOT be used to implement redirects. Instead, use the
FetchOptions::redirect_policy to specify how redirects should be handled.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".