Skip to main content

HttpRequest

Trait HttpRequest 

Source
pub trait HttpRequest: Send + Sync {
    // Required method
    fn fetch<T>(
        &self,
        request: Request<T>,
    ) -> impl Future<Output = Result<Response<Bytes>>> + Send
       where T: Body + Any + Send,
             T::Data: Into<Vec<u8>>,
             T::Error: Into<Box<dyn Error + Send + Sync + 'static>>;
}
Expand description

The HttpRequest trait defines the behavior for fetching data from a source.

Required Methods§

Source

fn fetch<T>( &self, request: Request<T>, ) -> impl Future<Output = Result<Response<Bytes>>> + Send
where T: Body + Any + Send, T::Data: Into<Vec<u8>>, T::Error: Into<Box<dyn Error + Send + Sync + 'static>>,

Make outbound HTTP request.

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.

Implementors§