futures_codec 0.1.1

Utilities for encoding and decoding frames using `async/await`
docs.rs failed to build futures_codec-0.1.1
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: futures_codec-0.4.1

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.

# #![feature(async_await, await_macro)]
# use futures::{SinkExt, TryStreamExt};
# use std::io::Cursor;
use bytes::Bytes;
use futures_codec::{BytesCodec, Framed};

async move {
# let mut buf = vec![];
# let stream = Cursor::new(&mut buf);
let mut framed = Framed::new(stream, BytesCodec {});

let msg = Bytes::from("Hello World!");
await!(framed.send(msg)).unwrap();

while let Some(msg) = await!(framed.try_next()).unwrap() {
println!("{:?}", msg);
}
};