[][src]Trait actix_web::Responder

pub trait Responder {
    type Item: Into<AsyncResult<HttpResponse>>;
    type Error: Into<Error>;
    fn respond_to<S: 'static>(
        req: &HttpRequest<S>
    ) -> 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

The associated item which can be returned.

The associated error which can be returned.

Required Methods

Convert itself to AsyncResult or Error.

Implementations on Foreign Types

impl<T> Responder for Option<T> where
    T: Responder

impl<T: Responder, E: Into<Error>> Responder for Result<T, E>

impl<I, E> Responder for Box<Future<Item = I, Error = E>> where
    I: Responder + 'static,
    E: Into<Error> + 'static, 

impl Responder for &'static str

impl Responder for &'static [u8]

impl Responder for String

impl<'a> Responder for &'a String

impl Responder for Bytes

impl Responder for BytesMut


impl Responder for Binary

impl Responder for AsyncResult<HttpResponse>

impl Responder for HttpResponseBuilder

impl Responder for HttpResponse

impl<A, B> Responder for Either<A, B> where
    A: Responder,
    B: Responder

impl<C: StaticFileConfig> Responder for NamedFile<C>

impl<T> Responder for InternalError<T> where
    T: Send + Sync + Debug + Display + 'static, 

impl<T: Serialize> Responder for Json<T>