hopr_chain_rpc

Trait HttpPostRequestor

Source
pub trait HttpPostRequestor: Send + Sync {
    // Required method
    fn http_post<'life0, 'life1, 'async_trait, T>(
        &'life0 self,
        url: &'life1 str,
        data: T,
    ) -> Pin<Box<dyn Future<Output = Result<Box<[u8]>, HttpRequestError>> + Send + 'async_trait>>
       where T: Serialize + Send + Sync + 'async_trait,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Abstraction for an HTTP client that performs HTTP POST with serializable request data.

Required Methods§

Source

fn http_post<'life0, 'life1, 'async_trait, T>( &'life0 self, url: &'life1 str, data: T, ) -> Pin<Box<dyn Future<Output = Result<Box<[u8]>, HttpRequestError>> + Send + 'async_trait>>
where T: Serialize + Send + Sync + 'async_trait, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Performs HTTP POST of JSON data to the given URL and gets the JSON response.

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§