send_body

Attribute Macro send_body 

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

#[send_body]
async fn auto_send_body_handler(ctx: Context) {
    let _ = ctx.set_response_body("Response body content").await;
    // Only response body is automatically sent after function returns
}

The macro takes no parameters and should be applied directly to async functions that accept a Context parameter.