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