Trait postmark::Endpoint

source ·
pub trait Endpoint {
    type Request: Serialize + Send + Sync;
    type Response: DeserializeOwned + Send + Sync;

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

    // Provided method
    fn method(&self) -> Method { ... }
}
Expand description

A trait for providing the necessary information for a single REST API endpoint.

Required Associated Types§

Required Methods§

source

fn endpoint(&self) -> Cow<'static, str>

The path to the endpoint.

source

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

The body for the endpoint.

Provided Methods§

source

fn method(&self) -> Method

The http method for the endpoint

Implementors§