Trait PostRequest

Source
pub trait PostRequest: Sized {
    type Request: Encodable;

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

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

POST Request method.

Required Associated Types§

Source

type Request: Encodable

Request body type.

Required Methods§

Source

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

Get path of request.

Source

fn body(&self) -> Self::Request

Get body of request.

Provided Methods§

Source

fn request(self) -> Post<Self>

Turn self 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: PostRequest> PostRequest for &T

Source§

type Request = <T as PostRequest>::Request

Source§

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

Source§

fn body(&self) -> Self::Request

Implementors§