Skip to main content

Fetch

Trait Fetch 

Source
pub trait Fetch: MaybeSendSync {
    // Required method
    fn get<'life0, 'life1, 'async_trait>(
        &'life0 self,
        url: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<FetchResponse, FetchError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

An HTTP client, as much of one as fetching a JWKS needs.

Implementations must, so that the rules in the module documentation hold on every host:

  • not follow redirects, but answer a 3xx with its Location;
  • give up after FETCH_TIMEOUT;
  • stop reading, and fail, once a body exceeds MAX_JWKS_BYTES.

Required Methods§

Source

fn get<'life0, 'life1, 'async_trait>( &'life0 self, url: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<FetchResponse, FetchError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

GET an absolute http or https URL this module has already checked.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§