#[send]Expand description
Automatically sends the complete response after function execution.
This attribute macro ensures that the response (request headers and body) is automatically sent to the client after the function completes execution.
ยงUsage
use hyperlane::*;
use hyperlane_macros::*;
#[route("/send")]
struct SendTest;
impl ServerHook for SendTest {
async fn new(_ctx: &Context) -> Self {
Self
}
#[epilogue_macros(send)]
async fn handle(self, ctx: &Context) {}
}
impl SendTest {
#[send]
async fn send_with_ref_self(&self, ctx: &Context) {}
}
#[send]
async fn standalone_send_handler(ctx: &Context) {}The macro takes no parameters and should be applied directly to async functions
that accept a &Context parameter.