Skip to content

Utilities for encoding and decoding frames with async/await

License

Notifications You must be signed in to change notification settings

romanb/futures-codec

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Utilities for encoding and decoding frames with async/await

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 100.0%