Function choices::warp::reply::with_header [−][src]
pub fn with_header<T, K, V>(reply: T, name: K, value: V) -> WithHeader<T> where
T: Reply,
HeaderName: TryFrom<K>,
<HeaderName as TryFrom<K>>::Error: Into<Error>,
HeaderValue: TryFrom<V>,
<HeaderValue as TryFrom<V>>::Error: Into<Error>,
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") });