Endpoint

Trait Endpoint 

Source
pub trait Endpoint {
    // Required methods
    fn method(&self) -> Method;
    fn endpoint(&self) -> Cow<'static, str>;

    // Provided methods
    fn parameters(&self) -> QueryParams<'_> { ... }
    fn body(&self) -> Result<Option<(&'static str, Vec<u8>)>, BodyError> { ... }
}
Expand description

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

Required Methods§

Source

fn method(&self) -> Method

The HTTP method to use for the endpoint.

Source

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

The path to the endpoint.

Provided Methods§

Source

fn parameters(&self) -> QueryParams<'_>

Query parameters for the endpoint.

Source

fn body(&self) -> Result<Option<(&'static str, Vec<u8>)>, BodyError>

The body for the endpoint.

Returns the Content-Encoding header for the data as well as the data itself.

Implementors§