Macro kvarn::package

source ·
macro_rules! package {
    ($response:pat, $request:pat, $host:pat, $(move |$($move:ident:$ty:ty ),+|)? $code:block) => { ... };
}
Expand description

Construct a Package extension like you write closures.

See crate::prepare! for usage and useful examples. See super::PackageCall for a list of arguments.

Examples

let extension = package!(response, _, _, {
    response.headers_mut().insert("x-author", HeaderValue::from_static("Icelk"));
    println!("Response headers {:#?}", response.headers());
});