Registry / async / tokio-util

tokio-util

JSON →
library0.7.18rscratesunverified

Additional utilities for working with Tokio, including codecs, time, and I/O helpers.

# Cargo.toml [dependencies] tokio-util = "0.7.18"
INSTALL
IMPORT
SIG · TOKIO-UTIL
T
tokio-util
asyncrustv0.7.18
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.

FramedRead
use tokio_util::codec::FramedRead;

Demonstrates reading a file line by line using FramedRead and LinesCodec from tokio-util.

use tokio_util::codec::{FramedRead, LinesCodec}; use tokio::fs::File; #[tokio::main] async fn main() -> Result<(), Box<dyn std::error::Error>> { let file = File::open("example.txt").await?; let mut stream = FramedRead::new(file, LinesCodec::new()); while let Some(line) = stream.next().await { println!("{}", line?); } Ok(()) }
Debug
Known issues
gotchaRequires a Tokio runtime to be active (e.g., #[tokio::main]).
fix
Ensure your project depends on tokio with the `rt` feature and uses an async main attribute.
affects: >=0.7.0
Upgrade
Version history
0.7.18latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
29 hits · last 30 days
node
24
OpenAI (training)
1
Resources
tokio-util — cargo add tokio-util · libregistry