#future #futures #async #codec

asynchronous-codec

Utilities for encoding and decoding frames using async/await

2 unstable releases

0.6.0 Feb 1, 2021
0.5.0 Jan 6, 2021

#84 in Asynchronous

Download history 26552/week @ 2021-05-30 31351/week @ 2021-06-06 28614/week @ 2021-06-13 28037/week @ 2021-06-20 24604/week @ 2021-06-27 31515/week @ 2021-07-04 26180/week @ 2021-07-11 28391/week @ 2021-07-18 26136/week @ 2021-07-25 34643/week @ 2021-08-01 27279/week @ 2021-08-08 30471/week @ 2021-08-15 35095/week @ 2021-08-22 37271/week @ 2021-08-29 35121/week @ 2021-09-05 47674/week @ 2021-09-12

88,908 downloads per month
Used in 112 crates (29 directly)

MIT license

48KB
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.

Latest Version Rust Documentation LICENSE

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

~1–1.5MB
~29K SLoC