trace

Attribute Macro trace 

Source
#[trace]
Expand description

Attribute macro to automatically instrument async functions

§Example

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

This macro will:

  • Register the function as a tracked task
  • Automatically label each .await point
  • Track execution time
  • Report completion or failure