Skip to main content

Request

Trait Request 

Source
pub trait Request {
    type Error;

    // Required methods
    fn request<T, U>(
        &self,
        method: &Method,
        endpoint: &str,
        payload: &T,
    ) -> impl Future<Output = Result<U, Self::Error>> + Send
       where T: ?Sized + Serialize + Debug + Send + Sync,
             U: DeserializeOwned + Debug + Send + Sync;
    fn execute(
        &self,
        request: Request,
    ) -> impl Future<Output = Result<Response, Self::Error>> + Send;
}
Expand description

Low-level request execution, kept for the historical surface.

Required Associated Types§

Required Methods§

Source

fn request<T, U>( &self, method: &Method, endpoint: &str, payload: &T, ) -> impl Future<Output = Result<U, Self::Error>> + Send

Source

fn execute( &self, request: Request, ) -> impl Future<Output = Result<Response, Self::Error>> + Send

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§