Skip to main content

Crate async_reify

Crate async_reify 

Source
Expand description

§async-reify

Instrument async functions to extract their continuation structure as an inspectable, serializable step graph.

The core workflow:

  1. Wrap futures in TracedFuture to record PollEvents
  2. Use LabeledFuture to attach source labels to await points
  3. Extract an AsyncStepGraph from the collected trace
  4. 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 LabeledFuture with automatic source labeling.

Structs§

AsyncStepGraph
An extracted async step graph.
LabeledFuture
A future that records poll events with a source label into a shared Trace.
PollEvent
A recorded poll event.
StepNode
A node in the async step graph.
Trace
Collected trace from a TracedFuture.
TracedFuture
A future wrapper that records each poll as a PollEvent.

Enums§

PollResult
The outcome of a single poll.
StepOutcome
The outcome of an async step.

Functions§

reify_execution
Extract an AsyncStepGraph from a sequence of PollEvents.
to_dot
Render an AsyncStepGraph as a Graphviz DOT string.