asynchronous-codec

Crates.ioasynchronous-codec
lib.rsasynchronous-codec
version0.7.0
created_at2021-01-06 11:13:16.160991+00
updated_at2023-10-11 16:03:12.245241+00
descriptionUtilities for encoding and decoding frames using `async/await`
homepagehttps://github.com/mxinden/asynchronous-codec
repositoryhttps://github.com/mxinden/asynchronous-codec
max_upload_size
id333037
size66,818
João Oliveira (jxs)

documentation

https://docs.rs/crate/asynchronous-codec

README

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);
    }
}
Commit count: 137

cargo fmt