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