Trait ruma_api::Endpoint [] [src]

pub trait Endpoint {
    type BodyParams: Deserialize + Serialize;
    type PathParams;
    type QueryParams: Deserialize + Serialize;
    type Response: Deserialize + Serialize;
    fn method() -> Method;
    fn request_path(params: Self::PathParams) -> String;
    fn router_path() -> String;
}

An API endpoint.

Associated Types

Request parameters supplied via the body of the HTTP request.

Request parameters supplied via the URL's path.

Parameters supplied via the URL's query string.

The body of the response.

Required Methods

Returns the HTTP method used by this endpoint.

Generates the path component of the URL for this endpoint using the supplied parameters.

Generates a generic path component of the URL for this endpoint, suitable for Router from the router crate.

Implementors