#[future_fn]Expand description
Instruments an async function to track its lifecycle as a Future.
This attribute macro wraps async functions with the future! macro, enabling
tracking of poll counts, state transitions (pending/ready/cancelled), and
optionally logging the result value.
§Parameters
log- Iftrue, logs the result value when the future completes (requiresDebugon return type)
§Examples
Basic usage (no Debug requirement on return type):
#[hotpath::future_fn]
async fn fetch_data() -> Vec<u8> {
// This future's lifecycle will be tracked
vec![1, 2, 3]
}With result logging (requires Debug on return type):
#[hotpath::future_fn(log = true)]
async fn compute() -> i32 {
// The result value will be logged in TUI console
42
}