request_version

Attribute Macro request_version 

Source
#[request_version]
Expand description

Extracts the HTTP request version into a variable.

This attribute macro retrieves the HTTP version from the request and makes it available as a variable. The version represents the HTTP protocol version used.

ยงUsage

use hyperlane::*;
use hyperlane_macros::*;

#[request_version(http_version)]
async fn handle_with_version(ctx: Context) {
    // Use the HTTP version
}

The macro accepts a variable name that will contain the HTTP request version. The variable will be available as a RequestVersion type in the function scope.