#[send_with_data]Expand description
Sends the complete response with data 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, with the specified data.
ยงUsage
use hyperlane::*;
use hyperlane_macros::*;
#[route("/send_with_data")]
struct SendWithData;
impl ServerHook for SendWithData {
async fn new(_ctx: &Context) -> Self {
Self
}
#[epilogue_macros(send_with_data("Hello, World!"))]
async fn handle(self, ctx: &Context) {}
}The macro accepts data to send and should be applied to async functions
that accept a &Context parameter.