5 unstable releases
0.7.0 | Oct 11, 2023 |
---|---|
0.6.2 | Jul 20, 2023 |
0.6.1 | Nov 8, 2022 |
0.6.0 | Feb 1, 2021 |
0.5.0 | Jan 6, 2021 |
#74 in Asynchronous
441,010 downloads per month
Used in 510 crates
(76 directly)
53KB
1K
SLoC
Asynchronous Codec
Utilities for encoding and decoding frames using async/await.
This is a fork of futures-codec
by Matt Hunzinger borrowing many concepts from
tokio-codec
.
Contains adapters to go from streams of bytes, AsyncRead
and AsyncWrite
,
to framed streams implementing Sink
and Stream
. Framed streams are also known as transports.
Example
use asynchronous_codec::{LinesCodec, Framed};
async fn main() {
// let stream = ...
let mut framed = Framed::new(stream, LinesCodec {});
while let Some(line) = framed.try_next().await.unwrap() {
println!("{:?}", line);
}
}
Dependencies
~0.8–1.5MB
~28K SLoC