pub trait Responder {
type Item: Into<AsyncResult<HttpResponse>>;
type Error: Into<Error>;
fn respond_to<S: 'static>(
self,
req: &HttpRequest<S>
) -> Result<Self::Item, Self::Error>;
}
Expand description
Trait implemented by types that generate responses for clients.
Types that implement this trait can be used as the return type of a handler.
Required Associated Types
sourcetype Item: Into<AsyncResult<HttpResponse>>
type Item: Into<AsyncResult<HttpResponse>>
The associated item which can be returned.
Required Methods
sourcefn respond_to<S: 'static>(
self,
req: &HttpRequest<S>
) -> Result<Self::Item, Self::Error>
fn respond_to<S: 'static>(
self,
req: &HttpRequest<S>
) -> Result<Self::Item, Self::Error>
Convert itself to AsyncResult
or Error
.