#[http1_1_or_higher_version]Expand description
Restricts function execution to HTTP/1.1 or higher protocol versions.
This attribute macro ensures the decorated function only executes for HTTP/1.1 or newer protocol versions, including HTTP/2, HTTP/3, and future versions.
ยงUsage
use hyperlane::*;
use hyperlane_macros::*;
#[route("/http1_1_or_higher_version")]
struct Http11OrHigher;
impl ServerHook for Http11OrHigher {
async fn new(_: &mut Stream, _: &mut Context) -> Self {
Self
}
#[prologue_macros(http1_1_or_higher_version, response_body("http1_1_or_higher_version"))]
async fn handle(self, stream: &mut Stream, ctx: &mut Context) -> Status { Status::Continue }
}
impl Http11OrHigher {
#[http1_1_or_higher_version]
async fn http1_1_or_higher_version_with_ref_self(&self, stream: &mut Stream, ctx: &mut Context) -> Status { Status::Continue }
}
#[http1_1_or_higher_version]
async fn standalone_http1_1_or_higher_version_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.