#[closed]Expand description
Handles closed connection scenarios.
This attribute macro configures the function to handle cases where the connection has been closed, providing appropriate handling for terminated or disconnected connections.
ยงUsage
use hyperlane::*;
use hyperlane_macros::*;
#[route("/get_post")]
struct GetPost;
impl ServerHook for GetPost {
async fn new(_ctx: &Context) -> Self {
Self
}
#[closed]
#[prologue_macros(
http,
methods(get, post),
response_body("get_post")
)]
async fn handle(self, ctx: &Context) {}
}The macro takes no parameters and should be applied directly to async functions
that accept a &Context parameter.