Trait actix_web::Responder
[−]
[src]
pub trait Responder { type Item: Into<Reply>; type Error: Into<Error>; fn respond_to(self, req: HttpRequest) -> Result<Self::Item, Self::Error>; }
Trait implemented by types that generate responses for clients.
Types that implement this trait can be used as the return type of a handler.
Associated Types
type Item: Into<Reply>
The associated item which can be returned.
type Error: Into<Error>
The associated error which can be returned.
Required Methods
fn respond_to(self, req: HttpRequest) -> Result<Self::Item, Self::Error>
Convert itself to Reply
or Error
.
Implementations on Foreign Types
impl<T: Responder, E: Into<Error>> Responder for Result<T, E>
[src]
impl<I, E> Responder for Box<Future<Item = I, Error = E>> where
I: Responder + 'static,
E: Into<Error> + 'static,
[src]
I: Responder + 'static,
E: Into<Error> + 'static,
type Item = Reply
type Error = Error
fn respond_to(self, req: HttpRequest) -> Result<Reply, Error>
[src]
impl Responder for &'static str
[src]
type Item = HttpResponse
type Error = HttpError
fn respond_to(self, _: HttpRequest) -> Result<HttpResponse, HttpError>
[src]
impl Responder for &'static [u8]
[src]
type Item = HttpResponse
type Error = HttpError
fn respond_to(self, _: HttpRequest) -> Result<HttpResponse, HttpError>
[src]
impl Responder for String
[src]
type Item = HttpResponse
type Error = HttpError
fn respond_to(self, _: HttpRequest) -> Result<HttpResponse, HttpError>
[src]
impl<'a> Responder for &'a String
[src]
type Item = HttpResponse
type Error = HttpError
fn respond_to(self, _: HttpRequest) -> Result<HttpResponse, HttpError>
[src]
impl Responder for Bytes
[src]
type Item = HttpResponse
type Error = HttpError
fn respond_to(self, _: HttpRequest) -> Result<HttpResponse, HttpError>
[src]
impl Responder for BytesMut
[src]
type Item = HttpResponse
type Error = HttpError
fn respond_to(self, _: HttpRequest) -> Result<HttpResponse, HttpError>
[src]
Implementors
impl<A, B> Responder for Either<A, B> where
A: Responder,
B: Responder, type Item = Reply; type Error = Error;impl Responder for Reply type Item = Reply; type Error = Error;
impl Responder for HttpResponse type Item = Reply; type Error = Error;
impl Responder for HttpResponseBuilder type Item = HttpResponse; type Error = HttpError;
impl<T: Serialize> Responder for Json<T> type Item = HttpResponse; type Error = Error;
impl Responder for NamedFile type Item = HttpResponse; type Error = Error;
impl Responder for Directory type Item = HttpResponse; type Error = Error;
impl Responder for FilesystemElement type Item = HttpResponse; type Error = Error;
impl<T> Responder for InternalError<T> where
T: Send + Sync + Debug + 'static, type Item = HttpResponse; type Error = Error;impl Responder for StaticResponse type Item = HttpResponse; type Error = HttpError;