Expand description
Reply Filters
These “filters” behave a little differently than the rest. Instead of being used directly on requests, these filters “wrap” other filters.
§Wrapping a Filter (with)
use warp::Filter;
let with_server = warp::reply::with::header("server", "warp");
let route = warp::any()
.map(warp::reply)
.with(with_server);Wrapping allows adding in conditional logic before the request enters
the inner filter (though the with::header wrapper does not).
Structs§
- Wrap a
Filterto set a header if it is not already set. - Wrap a
Filterto always set a header. - Wrap a
Filterto always set multiple headers.