#[future_fn]Expand description
Instruments an async function to track its lifecycle as a Future.
Wraps the function body with the future! macro to track poll counts,
state transitions (pending/ready/cancelled), and optionally the output value.
Can only be applied to async fn.
§Parameters
log- Iftrue, logs the output value on completion (requiresDebugon return type)
§Examples
#[hotpath::future_fn]
async fn fetch_data() -> Vec<u8> {
vec![1, 2, 3]
}
#[hotpath::future_fn(log = true)]
async fn compute() -> i32 {
42
}