send_with_data

Attribute Macro send_with_data 

Source
#[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::*;

#[send_with_data("Hello, World!")]
async fn auto_send_with_data_handler(ctx: Context) {
    // Response is automatically sent with the specified data after function returns
}

The macro accepts data to send and should be applied to async functions that accept a Context parameter.