#[connect_method]Expand description
Restricts function execution to HTTP CONNECT requests only.
This attribute macro ensures the decorated function only executes when the incoming request uses the CONNECT HTTP method. Requests with other methods will be filtered out.
ยงUsage
use hyperlane::*;
use hyperlane_macros::*;
#[route("/connect_method")]
struct Connect;
impl ServerHook for Connect {
async fn new(_ctx: &mut Context) -> Self {
Self
}
#[prologue_macros(connect_method, response_body("connect_method"))]
async fn handle(self, ctx: &mut Context) {}
}
impl Connect {
#[connect_method]
async fn connect_with_ref_self(&self, ctx: &mut Context) {}
}
#[connect_method]
async fn standalone_connect_handler(ctx: &mut Context) {}The macro takes no parameters and should be applied directly to async functions
that accept a &mut Context parameter.