pub trait InspectExt: Future + Sized {
// Provided methods
fn inspect(self, name: impl Into<String>) -> TrackedFuture<Self> ⓘ { ... }
fn spawn_tracked(self, name: impl Into<String>) -> JoinHandle<Self::Output>
where Self: Send + 'static,
Self::Output: Send + 'static { ... }
}Expand description
Extension trait for async-std futures to add tracking
§Examples
use async_inspect::runtime::async_std::InspectExt;
async_std::task::block_on(async {
let result = async {
// Your async code
42
}
.inspect("my_operation")
.await;
});Provided Methods§
Sourcefn inspect(self, name: impl Into<String>) -> TrackedFuture<Self> ⓘ
fn inspect(self, name: impl Into<String>) -> TrackedFuture<Self> ⓘ
Wrap this future with automatic tracking
Sourcefn spawn_tracked(self, name: impl Into<String>) -> JoinHandle<Self::Output>
fn spawn_tracked(self, name: impl Into<String>) -> JoinHandle<Self::Output>
Spawn this future on async-std with tracking
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.