Registry / async / async-compat

async-compat

JSON →
library0.2.5rscratesunverified

Compatibility adapter between Tokio and futures-based async runtimes.

# Cargo.toml [dependencies] async-compat = "0.2.5"
INSTALL
IMPORT
SIG · ASYNC-COMPAT
A
async-compat
asyncrustv0.2.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Compat
use async_compat::Compat;

Wraps a future to run on a Tokio runtime from futures ecosystem.

use async_compat::Compat; use futures::executor::block_on; async fn hello() { println!("Hello from async"); } fn main() { block_on(Compat::new(hello())); }
Debug
Known issues
gotchaRequires Tokio runtime to be active when using Compat; otherwise panics.
fix
Ensure a Tokio runtime is running before calling Compat::new.
affects: >=0.2.0
Upgrade
Version history
0.2.5latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
57 hits · last 30 days
node
50
Resources
async-compat — cargo add async-compat · libregistry