Function warp::filters::header::headers_cloned

source ·
pub fn headers_cloned() -> impl Filter<Extract = (HeaderMap,), Error = Infallible> + Copy
Expand description

Create a Filter that returns a clone of the request’s HeaderMap.

§Example

use warp::{Filter, http::HeaderMap};

let headers = warp::header::headers_cloned()
    .map(|headers: HeaderMap| {
        format!("header count: {}", headers.len())
    });