kvarn

Macro package

source
macro_rules! package {
    ($response:pat, $request:pat, $host:pat, $addr: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());
});