macro_rules! future {
($fut:expr) => { ... };
($fut:expr, label = $label:expr) => { ... };
($fut:expr, log = true) => { ... };
($fut:expr, label = $label:expr, log = true) => { ... };
($fut:expr, log = true, label = $label:expr) => { ... };
}Expand description
Instrument a future to inspect future’s lifecycle events.
Optional parameters: label, log = true.
log = true requires Debug on the output type and prints Ready(value).
§Examples
ⓘ
use hotpath::future;
// Without logging (works with any output type)
let result = future!(async { NoDebugType::new() }).await;
// With logging (requires Debug on output type)
let result = future!(async { 42 }, log = true).await;