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() -> &'static str;
    fn name() -> &'static str;
    fn description() -> &'static str;
    fn requires_authentication() -> bool;
    fn rate_limited() -> bool;
}

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.

A unique identifier for this endpoint, suitable for Router from the router crate.

A human-readable description of the endpoint.

Whether or not this endpoint requires an authenticated user.

Whether or not this endpoint is rate limited.

Implementors