#codec #async #future #networking #async-io

asynchronous-codec

Utilities for encoding and decoding frames using async/await

5 unstable releases

0.7.0 Oct 11, 2023
0.6.2 Jul 20, 2023
0.6.1 Nov 8, 2022
0.6.0 Feb 1, 2021
0.5.0 Jan 6, 2021

#48 in Asynchronous

Download history 107322/week @ 2024-10-08 113911/week @ 2024-10-15 104678/week @ 2024-10-22 99268/week @ 2024-10-29 101921/week @ 2024-11-05 95767/week @ 2024-11-12 102612/week @ 2024-11-19 100579/week @ 2024-11-26 115894/week @ 2024-12-03 124817/week @ 2024-12-10 119560/week @ 2024-12-17 57997/week @ 2024-12-24 81878/week @ 2024-12-31 143201/week @ 2025-01-07 164964/week @ 2025-01-14 126181/week @ 2025-01-21

531,839 downloads per month
Used in 588 crates (85 directly)

MIT license

53KB
1K SLoC

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

Dependencies

~0.8–1.5MB
~27K SLoC

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy