[][src]Trait tide::IntoResponse

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

    fn with_status(self, status: StatusCode) -> WithStatus<Self> { ... }
}

A value that is synchronously convertable into a Response.

Required methods

fn into_response(self) -> Response

Convert the value into a Response.

Loading content...

Provided methods

fn with_status(self, status: StatusCode) -> WithStatus<Self>

Create a new IntoResponse value that will respond with the given status code.

let resp = "Hello, 404!".with_status(http::status::StatusCode::NOT_FOUND).into_response();
assert_eq!(resp.status(), http::status::StatusCode::NOT_FOUND);
Loading content...

Implementations on Foreign Types

impl IntoResponse for ()[src]

fn with_status(self, status: StatusCode) -> WithStatus<Self>[src]

impl IntoResponse for Vec<u8>[src]

fn with_status(self, status: StatusCode) -> WithStatus<Self>[src]

impl IntoResponse for String[src]

fn with_status(self, status: StatusCode) -> WithStatus<Self>[src]

impl<'_> IntoResponse for &'_ str[src]

fn with_status(self, status: StatusCode) -> WithStatus<Self>[src]

impl IntoResponse for StatusCode[src]

fn with_status(self, status: StatusCode) -> WithStatus<Self>[src]

impl<T: IntoResponse, U: IntoResponse> IntoResponse for Result<T, U>[src]

fn with_status(self, status: StatusCode) -> WithStatus<Self>[src]

impl<T: Send + Into<Body>> IntoResponse for Response<T>[src]

fn with_status(self, status: StatusCode) -> WithStatus<Self>[src]

Loading content...

Implementors

impl IntoResponse for Bytes[src]

fn with_status(self, status: StatusCode) -> WithStatus<Self>[src]

impl<T: 'static + Send + Serialize> IntoResponse for Form<T>[src]

fn with_status(self, status: StatusCode) -> WithStatus<Self>[src]

impl<T: Send + Serialize> IntoResponse for Json<T>[src]

fn with_status(self, status: StatusCode) -> WithStatus<Self>[src]

Loading content...