Trait nickel::Responder
[−]
[src]
pub trait Responder<D> { fn respond<'a>(self, Response<'a, D>) -> MiddlewareResult<'a, D>; }
This trait provides convenience for translating a number
of common return types into a MiddlewareResult
while
also modifying the Response
as required.
Please see the examples for some uses.
Required Methods
fn respond<'a>(self, Response<'a, D>) -> MiddlewareResult<'a, D>
Implementors
impl<D> Responder<D> for ()
impl<D> Responder<D> for Json
impl<T, E, D> Responder<D> for Result<T, E> where T: Responder<D>, NickelError<'e, D>: From<(Response<'e, D>, E)>
impl<'a, D> Responder<D> for &'a [u8]
impl<'a, D> Responder<D> for Vec<u8>
impl<'a, D> Responder<D> for &'a str
impl<'a, D> Responder<D> for String
impl<'a, D> Responder<D> for (StatusCode, &'static str)
impl<'a, D> Responder<D> for (StatusCode, String)
impl<'a, D> Responder<D> for StatusCode
impl<'a, D> Responder<D> for &'a [&'a str]
impl<'a, D> Responder<D> for &'a [String]
impl<'a, D> Responder<D> for (u16, &'static str)
impl<'a, D> Responder<D> for (u16, String)