Expand description
§async-reify
Instrument async functions to extract their continuation structure as an inspectable, serializable step graph.
The core workflow:
- Wrap futures in
TracedFutureto recordPollEvents - Use
LabeledFutureto attach source labels to await points - Extract an
AsyncStepGraphfrom the collected trace - Optionally serialize to JSON or render as Graphviz DOT
§Examples
use async_reify::{TracedFuture, PollResult};
let (result, trace) = TracedFuture::run(async { 42 }).await;
assert_eq!(result, 42);
assert!(!trace.events.is_empty());
assert!(matches!(trace.events.last().unwrap().result, PollResult::Ready));Macros§
- labeled_
await - Helper macro to create a
LabeledFuturewith automatic source labeling.
Structs§
- Async
Step Graph - An extracted async step graph.
- Labeled
Future - A future that records poll events with a source label into a shared
Trace. - Poll
Event - A recorded poll event.
- Step
Node - A node in the async step graph.
- Trace
- Collected trace from a
TracedFuture. - Traced
Future - A future wrapper that records each poll as a
PollEvent.
Enums§
- Poll
Result - The outcome of a single poll.
- Step
Outcome - The outcome of an async step.
Functions§
- reify_
execution - Extract an
AsyncStepGraphfrom a sequence ofPollEvents. - to_dot
- Render an
AsyncStepGraphas a Graphviz DOT string.