#[http2_version]Expand description
Restricts function execution to HTTP/2 requests only.
This attribute macro ensures the decorated function only executes for HTTP/2 protocol requests.
ยงUsage
use hyperlane::*;
use hyperlane_macros::*;
#[route("/http2_version")]
struct Http2;
impl ServerHook for Http2 {
async fn new(_ctx: &Context) -> Self {
Self
}
#[prologue_macros(http2_version, response_body("http2_version"))]
async fn handle(self, ctx: &Context) {}
}
impl Http2 {
#[http2_version]
async fn http2_version_with_ref_self(&self, ctx: &Context) {}
}
#[http2_version]
async fn standalone_http2_version_handler(ctx: &Context) {}The macro takes no parameters and should be applied directly to async functions
that accept a &Context parameter.