pub trait Endpoint {
    type Output: IntoResponse + Send;
    type Placeholders: PathExtractor<Body> + Clone + Sync;
    type Params: QueryStringExtractor<Body> + Clone + Sync;
    type Body: RequestBody + Send;
    fn http_method() -> Method;
fn uri() -> Cow<'static, str>;
fn handle(
        state: &mut State,
        placeholders: Self::Placeholders,
        params: Self::Params,
        body: Option<Self::Body>
    ) -> BoxFuture<'_, Self::Output>; fn has_placeholders() -> bool { ... }
fn needs_params() -> bool { ... }
fn needs_body() -> bool { ... }
fn wants_auth() -> bool { ... } }

Associated Types

The output type that provides the response.

The type that parses the URI placeholders. Use NoopExtractor if has_placeholders() returns false.

The type that parses the request parameters. Use NoopExtractor if needs_params() returns false.

The type to parse the body into. Use () if needs_body() returns false.

Required methods

The HTTP Verb of this endpoint.

The URI that this endpoint listens on in gotham’s format.

The handler for this endpoint.

Provided methods

Returns true iff the URI contains placeholders. false by default.

Returns true iff the request parameters should be parsed. false by default.

Returns true iff the request body should be parsed. false by default.

Returns true if the request wants to know the auth status of the client. false by default.

Implementors