Crate async_inspect

Crate async_inspect 

Source
Expand description

Β§async-inspect πŸ”

X-ray vision for async Rust

async-inspect visualizes and inspects async state machines in Rust. See exactly what your futures are doing, where they’re stuck, and why.

Β§Quick Start

β“˜
use async_inspect::prelude::*;

#[async_inspect::trace]
async fn fetch_user(id: u64) -> User {
    let profile = fetch_profile(id).await;
    let posts = fetch_posts(id).await;
    User { profile, posts }
}

Β§Features

  • πŸ” State Machine Inspection - See current state and variables
  • ⏱️ Execution Timeline - Visualize async execution
  • πŸ’€ Deadlock Detection - Find circular dependencies
  • πŸ“Š Performance Analysis - Identify bottlenecks

Re-exportsΒ§

pub use error::Error;
pub use error::Result;
pub use inspector::Inspector;

ModulesΒ§

channel
Tracked channel primitives
config
Production configuration Production configuration and settings
dashboard
Web Dashboard for real-time monitoring Web dashboard for real-time async inspection
deadlock
Deadlock detection Deadlock detection and analysis
error
Error types
export
Export functionality Export functionality for various formats
graph
Task relationship graph Task relationship graph and visualization
inspector
Core inspection types and traits Core inspection functionality
instrument
Instrumentation and tracing Code instrumentation utilities
integrations
Ecosystem integrations Ecosystem integrations for async-inspect
lsp
Language Server Protocol (LSP) integration Language Server Protocol (LSP) integration for async-inspect
prelude
Prelude for convenient imports
profile
Performance profiling Performance profiling and analysis
reporter
Reporting and output Reporting and output formatting
runtime
Runtime integration hooks Runtime integration hooks
state_machine
State machine introspection
sync
Tracked synchronization primitives
task
Task tracking and monitoring Task tracking and monitoring
telemetry
Usage telemetry
timeline
Timeline and execution history Execution timeline tracking
tui
Terminal User Interface Terminal User Interface (TUI) for real-time async monitoring

MacrosΒ§

if_sampled
Helper to conditionally execute code only when sampling
inspect_point
Record an inspection point in async code
inspect_task_complete
Mark current task as completed
inspect_task_failed
Mark current task as failed
inspect_task_start
Begin tracking an async task
measure_overhead
Helper macro to measure and record overhead

Attribute MacrosΒ§

inspect
Attribute macro for inspecting specific code blocks
trace
Attribute macro to automatically instrument async functions