[][src]Module warp::filters::reply

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

WithDefaultHeader

Wrap a Filter to set a header if it is not already set.

WithHeader

Wrap a Filter to always set a header.

WithHeaders

Wrap a Filter to always set multiple headers.

Functions

default_header

Wrap a Filter that adds a header to the reply, if they aren't already set.

header

Wrap a Filter that adds a header to the reply.

headers

Wrap a Filter that adds multiple headers to the reply.