pub trait Endpoint {
    type Params<'a>: Debug + Send + Serialize
       where Self: 'a = ();
    type Response<T> = DefaultResponse<T>;

    const METHOD: Method;

    // Required methods
    fn path(&self) -> Path;
    fn params(&self) -> Self::Params<'_>;

    // Provided methods
    fn headers(&self) -> HeaderMap { ... }
    fn body(&self) -> Body { ... }
    fn optional(self) -> Optional<Self>
       where Self: Sized { ... }
    fn ignore(self) -> Ignore<Self>
       where Self: Sized { ... }
    fn raw(self) -> Raw<Self>
       where Self: Sized { ... }
    fn paginated(self, pagination: impl Into<Option<Pagination>>) -> Paged<Self>
       where Self: Sized { ... }
}

Provided Associated Types§

source

type Params<'a>: Debug + Send + Serialize where Self: 'a = ()

source

type Response<T> = DefaultResponse<T>

Required Associated Constants§

Required Methods§

source

fn path(&self) -> Path

source

fn params(&self) -> Self::Params<'_>

Provided Methods§

source

fn headers(&self) -> HeaderMap

source

fn body(&self) -> Body

body returns the opaque Body type because the actual body serialization may vary from endpoint to endpoint; e.g. one endpoint may want to use serde_json to serialize body data in json format while another may simply want to use the raw contents of a string as the bytes to be sent

source

fn optional(self) -> Optional<Self>where Self: Sized,

source

fn ignore(self) -> Ignore<Self>where Self: Sized,

source

fn raw(self) -> Raw<Self>where Self: Sized,

source

fn paginated(self, pagination: impl Into<Option<Pagination>>) -> Paged<Self>where Self: Sized,

Implementors§