[][src]Trait actix_web::Responder

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>; }

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<AsyncResult<HttpResponse>>

The associated item which can be returned.

type Error: Into<Error>

The associated error which can be returned.

Loading content...

Required methods

fn respond_to<S: 'static>(
    self,
    req: &HttpRequest<S>
) -> Result<Self::Item, Self::Error>

Convert itself to AsyncResult or Error.

Loading content...

Implementations on Foreign Types

impl<T> Responder for Option<T> where
    T: Responder
[src]

type Item = AsyncResult<HttpResponse>

type Error = Error

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

type Item = <T as Responder>::Item

type Error = Error

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

type Item = AsyncResult<HttpResponse>

type Error = Error

impl Responder for &'static str[src]

impl Responder for &'static [u8][src]

impl Responder for String[src]

impl<'a> Responder for &'a String[src]

impl Responder for Bytes[src]

impl Responder for BytesMut[src]

Loading content...

Implementors

impl Responder for Binary[src]

impl Responder for AsyncResult<HttpResponse>[src]

type Item = AsyncResult<HttpResponse>

type Error = Error

impl Responder for HttpResponseBuilder[src]

impl Responder for HttpResponse[src]

type Item = AsyncResult<HttpResponse>

type Error = Error

impl<A, B> Responder for Either<A, B> where
    A: Responder,
    B: Responder
[src]

type Item = AsyncResult<HttpResponse>

type Error = Error

impl<C: StaticFileConfig> Responder for NamedFile<C>[src]

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

impl<T: Serialize> Responder for Json<T>[src]

Loading content...