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

#199 in Asynchronous

Download history 32/week @ 2023-12-28 6/week @ 2024-01-11 12/week @ 2024-01-18 29/week @ 2024-01-25 58/week @ 2024-02-01 42/week @ 2024-02-08 111/week @ 2024-02-15 118/week @ 2024-02-22 187/week @ 2024-02-29 72/week @ 2024-03-07 56/week @ 2024-03-14 58/week @ 2024-03-21 99/week @ 2024-03-28 29/week @ 2024-04-04 28/week @ 2024-04-11

221 downloads per month
Used in 4 crates (3 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–15MB
~152K SLoC