Trait GetRequest

Source
pub trait GetRequest: Sized {
    type Response: Decodable;
    type Query: ToQuery;

    // Required methods
    fn path(&self) -> Cow<'_, str>;
    fn query(&self) -> Self::Query;

    // Provided method
    fn request(self) -> Get<Self> { ... }
}
Expand description

GET Request method.

The GET method requests a representation of the specified resource. Requests using GET should only retrieve data.

Required Associated Types§

Source

type Response: Decodable

Response type and encoding.

Source

type Query: ToQuery

Query type.

Required Methods§

Source

fn path(&self) -> Cow<'_, str>

URI path.

Source

fn query(&self) -> Self::Query

Query parameters.

Provided Methods§

Source

fn request(self) -> Get<Self>

Turn this into a 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.

Implementations on Foreign Types§

Source§

impl<T: GetRequest> GetRequest for &T

Source§

type Response = <T as GetRequest>::Response

Source§

type Query = <T as GetRequest>::Query

Source§

fn path(&self) -> Cow<'_, str>

Source§

fn query(&self) -> Self::Query

Implementors§