Macro kvarn::post

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

Construct a Post extension like you write closures.

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

Examples

let extension = post!(_, _, response_pipe, _, _, {
    match response_pipe {
        application::ResponsePipe::Http1(c) => println!("This is a HTTP/1 connection. {:?}", c),
        application::ResponsePipe::Http2(c) => println!("This is a HTTP/2 connection. {:?}", c),
    }
});