Trait HttpClient

Source
pub trait HttpClient:
    Debug
    + Clone
    + Send
    + Sync {
    // Required methods
    fn post<'life0, 'life1, 'async_trait, I, O>(
        &'life0 self,
        path: &'life1 str,
        request: I,
    ) -> Pin<Box<dyn Future<Output = Result<O, Error>> + Send + 'async_trait>>
       where I: 'async_trait + Serialize + Send,
             O: 'async_trait + DeserializeOwned,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn post_stream<'life0, 'life1, 'async_trait, I, O>(
        &'life0 self,
        path: &'life1 str,
        request: I,
    ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<O, Error>> + Send>>, Error>> + Send + 'async_trait>>
       where I: 'async_trait + Serialize + Send,
             O: 'async_trait + DeserializeOwned + Send + 'static,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}

Required Methods§

Source

fn post<'life0, 'life1, 'async_trait, I, O>( &'life0 self, path: &'life1 str, request: I, ) -> Pin<Box<dyn Future<Output = Result<O, Error>> + Send + 'async_trait>>
where I: 'async_trait + Serialize + Send, O: 'async_trait + DeserializeOwned, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn post_stream<'life0, 'life1, 'async_trait, I, O>( &'life0 self, path: &'life1 str, request: I, ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<O, Error>> + Send>>, Error>> + Send + 'async_trait>>
where I: 'async_trait + Serialize + Send, O: 'async_trait + DeserializeOwned + Send + 'static, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

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§