Crates.io | monoio-codec |
lib.rs | monoio-codec |
version | 0.3.4 |
source | src |
created_at | 2022-06-13 14:48:00.023462 |
updated_at | 2024-03-05 07:36:01.16303 |
description | Codec for Monoio. |
homepage | |
repository | https://github.com/monoio-rs/monoio-codec |
max_upload_size | |
id | 605153 |
size | 95,480 |
This crate provides 2 utils:
Framed
, FramedRead
and FramedWrite
: Like the same things in tokio-util, but with monoio pure async AsyncReadRent
, AsyncWriteRent
, Sink
and Stream
.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.