futures_codec

Crates.iofutures_codec
lib.rsfutures_codec
version0.4.1
sourcesrc
created_at2019-04-26 09:47:36.670475
updated_at2020-06-21 13:52:17.425058
descriptionUtilities for encoding and decoding frames using `async/await`
homepagehttps://github.com/matthunz/futures-codec
repositoryhttps://github.com/matthunz/futures-codec
max_upload_size
id130289
size51,311
Matt Hunzinger (matthunz)

documentation

https://docs.rs/crate/futures_codec

README

futures_codec

Utilities for encoding and decoding frames using async/await.

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 Build Status LICENSE

Example

use futures_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: 119

cargo fmt