#[send_once]Expand description
Sends the complete response exactly once after function execution.
This attribute macro ensures that the response is sent exactly once to the client, preventing multiple response transmissions for single-use scenarios.
ยงUsage
use hyperlane::*;
use hyperlane_macros::*;
#[route("/send_once")]
struct SendOnceTest;
impl ServerHook for SendOnceTest {
async fn new(_ctx: &Context) -> Self {
Self
}
#[epilogue_macros(send_once)]
async fn handle(self, ctx: &Context) {}
}
impl SendOnceTest {
#[send_once]
async fn send_once_with_ref_self(&self, ctx: &Context) {}
}
#[send_once]
async fn standalone_send_once_handler(ctx: &Context) {}The macro takes no parameters and should be applied directly to async functions
that accept a &Context parameter.