#[methods]
Expand description
Allows function to handle multiple HTTP methods.
This attribute macro configures the decorated function to execute for any of the specified HTTP methods. Methods should be provided as a comma-separated list.
ยงUsage
use hyperlane::*;
use hyperlane_macros::*;
#[methods(get, post)]
async fn handle_get_post(ctx: Context) {
// Function body
}
#[methods(put, patch, delete)]
async fn handle_modifications(ctx: Context) {
// Function body
}
The macro accepts a comma-separated list of HTTP method names (lowercase) and should be
applied to async functions that accept a Context
parameter.