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