[−][src]Trait warp::reply::Reply
Types that can be converted into a Response
.
This trait is implemented for the following:
http::StatusCode
http::Response<impl Into<hyper::Body>>
String
&'static str
Example
use warp::{Filter, http::Response}; struct Message { msg: String } impl warp::Reply for Message { fn into_response(self) -> warp::reply::Response { Response::new(format!("message: {}", self.msg).into()) } } fn handler() -> Message { Message { msg: "Hello".to_string() } } let route = warp::any().map(handler);
Required methods
fn into_response(self) -> Response
Converts the given value into a Response
.
Implementations on Foreign Types
impl<T: Reply + ?Sized> Reply for Box<T>
[src]
fn into_response(self) -> Response
[src]
impl<T: Send> Reply for Response<T> where
Body: From<T>,
[src]
Body: From<T>,
fn into_response(self) -> Response
[src]
impl Reply for StatusCode
[src]
fn into_response(self) -> Response
[src]
impl<T> Reply for Result<T, Error> where
T: Reply + Send,
[src]
T: Reply + Send,
fn into_response(self) -> Response
[src]
impl Reply for String
[src]
fn into_response(self) -> Response
[src]
impl Reply for Vec<u8>
[src]
fn into_response(self) -> Response
[src]
impl Reply for &'static str
[src]
fn into_response(self) -> Response
[src]
impl Reply for Cow<'static, str>
[src]
fn into_response(self) -> Response
[src]
impl Reply for &'static [u8]
[src]
fn into_response(self) -> Response
[src]
impl<T> Reply for (T,) where
T: Reply,
[src]
T: Reply,