Skip to content

Utilities for encoding and decoding frames using `async/await`.

License

Notifications You must be signed in to change notification settings

mxinden/asynchronous-codec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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);
    }
}