Attribute Macro post_hook

Source
#[post_hook]
Expand description

Executes a specified function after the main handler function.

This attribute macro configures a post-execution hook that runs after the main function logic. The main function will execute first, followed by the specified hook function.

ยงUsage

use hyperlane::*;
use hyperlane_macros::*;

#[send]
async fn post_handler(ctx: Context) {
    // Post-execution logic
}

#[post_hook(post_handler)]
async fn main_handler(ctx: Context) {
    // Main function logic (runs before post_handler)
}

The macro accepts a function name as parameter. Both the hook function and main function must accept a Context parameter. Avoid combining this macro with other macros on the same function to prevent macro expansion conflicts.