File: README.md

package info (click to toggle)
rust-asynchronous-codec 0.7.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 208 kB
  • sloc: makefile: 2
file content (30 lines) | stat: -rw-r--r-- 1,043 bytes parent folder | download
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
27
28
29
30
# Asynchronous Codec

Utilities for encoding and decoding frames using async/await.

This is a fork of [`futures-codec`](https://github.com/matthunz/futures-codec)
by [Matt Hunzinger](https://github.com/matthunz) borrowing many concepts from
[`tokio-codec`](https://crates.io/crates/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](https://img.shields.io/crates/v/asynchronous-codec.svg)](https://crates.io/crates/asynchronous-codec)
[![Rust Documentation](https://img.shields.io/badge/api-rustdoc-blue.svg)](https://docs.rs/asynchronous-codec)
![LICENSE](https://img.shields.io/badge/license-MIT-blue.svg)


### Example

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