Trait choices::warp::Reply [−][src]
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
pub fn into_response(self) -> Response<Body>
[src]
Converts the given value into a Response
.
Implementations on Foreign Types
impl Reply for &'static [u8]
[src]
pub fn into_response(self) -> Response<Body>
[src]
impl Reply for String
[src]
pub fn into_response(self) -> Response<Body>
[src]
impl Reply for &'static str
[src]
pub fn into_response(self) -> Response<Body>
[src]
impl Reply for Cow<'static, str>
[src]
pub fn into_response(self) -> Response<Body>
[src]
impl<T> Reply for Result<T, Error> where
T: Reply + Send,
[src]
T: Reply + Send,
pub fn into_response(self) -> Response<Body>
[src]
impl Reply for Infallible
[src]
pub fn into_response(self) -> Response<Body>
[src]
impl Reply for Vec<u8, Global>
[src]
pub fn into_response(self) -> Response<Body>
[src]
impl<T> Reply for Box<T, Global> where
T: Reply + ?Sized,
[src]
T: Reply + ?Sized,
pub fn into_response(self) -> Response<Body>
[src]
impl<T> Reply for (T,) where
T: Reply,
[src]
T: Reply,
pub fn into_response(self) -> Response<Body>
[src]
Implementors
impl Reply for File
[src]
pub fn into_response(self) -> Response<Body>
[src]
impl Reply for StatusCode
[src]
pub fn into_response(self) -> Response<Body>
[src]
impl Reply for Json
[src]
pub fn into_response(self) -> Response<Body>
[src]
impl<T> Reply for Response<T> where
T: Send,
Body: From<T>,
[src]
T: Send,
Body: From<T>,
pub fn into_response(self) -> Response<Body>
[src]
impl<T> Reply for Html<T> where
T: Send,
Body: From<T>,
[src]
T: Send,
Body: From<T>,
pub fn into_response(self) -> Response<Body>
[src]
impl<T> Reply for WithHeader<T> where
T: Reply,
[src]
T: Reply,
pub fn into_response(self) -> Response<Body>
[src]
impl<T> Reply for WithStatus<T> where
T: Reply,
[src]
T: Reply,