11 unstable releases (3 breaking)

0.3.4 Mar 5, 2024
0.3.1 Dec 20, 2023
0.3.0 Nov 14, 2023
0.1.0 Jun 15, 2023
0.0.0 Jan 15, 2024

#266 in Asynchronous

Download history 26/week @ 2024-07-29 22/week @ 2024-08-05 5/week @ 2024-08-12 7/week @ 2024-08-19 50/week @ 2024-08-26 1/week @ 2024-09-02 14/week @ 2024-09-09 10/week @ 2024-09-16 91/week @ 2024-09-23 13/week @ 2024-09-30 8/week @ 2024-10-07 47/week @ 2024-10-14 109/week @ 2024-10-21 219/week @ 2024-10-28 141/week @ 2024-11-04 95/week @ 2024-11-11

565 downloads per month
Used in 8 crates (5 directly)

MIT/Apache

76KB
1K SLoC

Monoio-codec

Crates.io MIT/Apache-2 licensed

This crate provides 2 utils:

  1. Framed, FramedRead and FramedWrite: Like the same things in tokio-util, but with monoio pure async AsyncReadRent, AsyncWriteRent, Sink and Stream.
  2. AsyncEncoder, AsyncDecoder: Trait for encode and decode in async streaming way.

If the target codec is designed such that all required data lengths can be read from the header at low cost, using synchronous codec can lead to better performance. If not, you can use our async codec trait.

Note: These 2 modes can be used at the same time because our Framed is also a BufIo. It implements AsyncReadRent and AsyncWriteRent. If users know how much data to read, read directly from it can avoid data copy or buffer growth.

Dependencies

~4–16MB
~141K SLoC