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