#[trace_method]Expand description
Restricts function execution to HTTP TRACE requests only.
This attribute macro ensures the decorated function only executes when the incoming request uses the TRACE HTTP method. Requests with other methods will be filtered out.
ยงUsage
use hyperlane::*;
use hyperlane_macros::*;
#[route("/trace_method")]
struct Trace;
impl ServerHook for Trace {
async fn new(_: &mut Stream, _: &mut Context) -> Self {
Self
}
#[prologue_macros(trace_method, response_body("trace_method"))]
async fn handle(self, stream: &mut Stream, ctx: &mut Context) -> Status { Status::Continue }
}
impl Trace {
#[trace_method]
async fn trace_with_ref_self(&self, stream: &mut Stream, ctx: &mut Context) -> Status { Status::Continue }
}
#[trace_method]
async fn standalone_trace_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.