[][src]Trait hyperbole::reply::Reply

pub trait Reply: Sized + Send {
    fn into_response(self) -> Response;

    fn with_status(self, code: StatusCode) -> Response { ... }
fn with_header<H: Header>(self, header: H) -> Response { ... } }

A type that can be converted into an http Response.

Required methods

fn into_response(self) -> Response

Perform the conversion.

Loading content...

Provided methods

fn with_status(self, code: StatusCode) -> Response

Change the status code to code.

use hyper::StatusCode;
use hyperbole::{reply::Reply, Response};

let _: Response = "some message" //
    .with_status(StatusCode::OK);

fn with_header<H: Header>(self, header: H) -> Response

Include a typed header in the response.

use headers::ContentType;
use hyperbole::{reply::Reply, Response};

let _: Response = "some message" //
    .with_header(ContentType::text());
Loading content...

Implementations on Foreign Types

impl Reply for Error[src]

impl<R: Reply, E: Reply> Reply for Result<R, E>[src]

impl Reply for Infallible[src]

impl Reply for CNil[src]

impl<H: Reply, Tail: Reply> Reply for Coproduct<H, Tail>[src]

impl<T: Reply> Reply for Box<T>[src]

impl<'a, T: ToOwned> Reply for Cow<'a, T> where
    &'a T: Reply,
    T::Owned: Reply
[src]

impl Reply for String[src]

impl Reply for &'static str[src]

impl Reply for Vec<u8>[src]

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

Loading content...

Implementors

impl Reply for AutoBodyError[src]

impl Reply for FormBodyError[src]

impl Reply for JsonBodyError[src]

impl Reply for CookieError[src]

impl Reply for FsError[src]

impl Reply for HeaderError[src]

impl Reply for Response[src]

impl<E: Send + Error> Reply for UriError<E>[src]

impl<S: Stream<Item = Vec<Event>> + Send + 'static> Reply for EventStream<S>[src]

impl<T: Reply, const NAME: &'static str> Reply for Field<T, NAME>[src]

Loading content...