pub trait Middleware {
    fn is_method_get_head(&self) -> bool;
fn policy(&self, response: &HttpResponse) -> Result<CachePolicy>;
fn policy_with_options(
        &self,
        response: &HttpResponse,
        options: CacheOptions
    ) -> Result<CachePolicy>;
fn update_headers(&mut self, parts: Parts) -> Result<()>;
fn set_no_cache(&mut self) -> Result<()>;
fn parts(&self) -> Result<Parts>;
fn url(&self) -> Result<&Url>;
fn method(&self) -> Result<String>;
fn remote_fetch<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Result<HttpResponse>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
; }
Expand description

Describes the functionality required for interfacing with HTTP client middleware

Required methods

Determines if the request method is either GET or HEAD

Returns a new cache policy with default options

Returns a new cache policy with custom options

Attempts to update the request headers with the passed http::request::Parts

Attempts to force the “no-cache” directive on the request

Attempts to construct http::request::Parts from the request

Attempts to determine the requested url

Attempts to determine the request method

Attempts to fetch an upstream resource and return an HttpResponse

Implementors