HttpClient

Trait HttpClient 

Source
pub trait HttpClient:
    Clone
    + Send
    + Sync {
    // Required method
    fn stream_request<'life0, 'life1, 'life2, 'async_trait, Query, Body, Output>(
        &'life0 self,
        url: &'life1 str,
        method: Method<Query, Body>,
        content_type: &'life2 str,
        expected_status_code: u16,
    ) -> Pin<Box<dyn Future<Output = Result<Output, Error>> + Send + 'async_trait>>
       where Query: 'async_trait + Serialize + Send + Sync,
             Body: 'async_trait + AsyncRead + Send + Sync + 'static,
             Output: 'async_trait + DeserializeOwned + 'static,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;

    // Provided methods
    fn request<'life0, 'life1, 'async_trait, Query, Body, Output>(
        &'life0 self,
        url: &'life1 str,
        method: Method<Query, Body>,
        expected_status_code: u16,
    ) -> Pin<Box<dyn Future<Output = Result<Output, Error>> + Send + 'async_trait>>
       where Query: Serialize + Send + Sync + 'async_trait,
             Body: Serialize + Send + Sync + 'async_trait,
             Output: DeserializeOwned + 'static + Send + 'async_trait,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn is_tokio(&self) -> bool { ... }
}

Required Methods§

Source

fn stream_request<'life0, 'life1, 'life2, 'async_trait, Query, Body, Output>( &'life0 self, url: &'life1 str, method: Method<Query, Body>, content_type: &'life2 str, expected_status_code: u16, ) -> Pin<Box<dyn Future<Output = Result<Output, Error>> + Send + 'async_trait>>
where Query: 'async_trait + Serialize + Send + Sync, Body: 'async_trait + AsyncRead + Send + Sync + 'static, Output: 'async_trait + DeserializeOwned + 'static, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Provided Methods§

Source

fn request<'life0, 'life1, 'async_trait, Query, Body, Output>( &'life0 self, url: &'life1 str, method: Method<Query, Body>, expected_status_code: u16, ) -> Pin<Box<dyn Future<Output = Result<Output, Error>> + Send + 'async_trait>>
where Query: Serialize + Send + Sync + 'async_trait, Body: Serialize + Send + Sync + 'async_trait, Output: DeserializeOwned + 'static + Send + 'async_trait, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn is_tokio(&self) -> bool

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.

Implementations on Foreign Types§

Source§

impl HttpClient for Infallible

Source§

fn request<'life0, 'life1, 'async_trait, Query, Body, Output>( &'life0 self, _url: &'life1 str, _method: Method<Query, Body>, _expected_status_code: u16, ) -> Pin<Box<dyn Future<Output = Result<Output, Error>> + Send + 'async_trait>>
where Query: Serialize + Send + Sync + 'async_trait, Body: Serialize + Send + Sync + 'async_trait, Output: DeserializeOwned + 'static + Send + 'async_trait, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn stream_request<'life0, 'life1, 'life2, 'async_trait, Query, Body, Output>( &'life0 self, _url: &'life1 str, _method: Method<Query, Body>, _content_type: &'life2 str, _expected_status_code: u16, ) -> Pin<Box<dyn Future<Output = Result<Output, Error>> + Send + 'async_trait>>
where Query: 'async_trait + Serialize + Send + Sync, Body: 'async_trait + AsyncRead + Send + Sync + 'static, Output: 'async_trait + DeserializeOwned + 'static, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Implementors§