pub trait Handler {
type Output;
type Error: Into<Error>;
type Handle: TryFuture<Ok = Self::Output, Error = Self::Error>;
fn allowed_methods(&self) -> Option<&AllowedMethods>;
fn handle(&self) -> Self::Handle;
}
Expand description
A trait representing the handler associated with the specified endpoint.
Required Associated Types
type Output
type Error: Into<Error>
type Handle: TryFuture<Ok = Self::Output, Error = Self::Error>
Required Methods
sourcefn allowed_methods(&self) -> Option<&AllowedMethods>
fn allowed_methods(&self) -> Option<&AllowedMethods>
Returns a list of HTTP methods that this handler accepts.
If it returns a None
, it means that the handler accepts all methods.