Function warp::reply::with_header
source · pub fn with_header<T: Reply, K, V>(reply: T, name: K, value: V) -> WithHeader<T>where
HeaderName: TryFrom<K>,
<HeaderName as TryFrom<K>>::Error: Into<Error>,
HeaderValue: TryFrom<V>,
<HeaderValue as TryFrom<V>>::Error: Into<Error>,
Expand description
Wrap an impl Reply
to add a header when rendering.
§Example
use warp::Filter;
let route = warp::any()
.map(warp::reply)
.map(|reply| {
warp::reply::with_header(reply, "server", "warp")
});