Trait Request

Source
pub trait Request: Sized {
    type Serializer: SerializeBody<Self>;
    type Response;

    // Required methods
    fn method(&self) -> HttpMethod;
    fn path(&self) -> String;
}

Required Associated Types§

Source

type Serializer: SerializeBody<Self>

Specify a pre-defined approach to serialize a request body. For example:

  • SerdeJson
  • NoBody
Source

type Response

Type to deserialize from the http response body

Required Methods§

Source

fn method(&self) -> HttpMethod

HTTP method that the request will be sent with

Source

fn path(&self) -> String

String to appended to the end of url when sending this 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§