1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
# 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.
[](https://crates.io/crates/futures-codec)
[](https://docs.rs/futures-codec)
[](https://travis-ci.com/matthunz/futures-codec)

### Example
```rust
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);
}
}
```
|