async-bincode

Crates.ioasync-bincode
lib.rsasync-bincode
version0.7.2
sourcesrc
created_at2018-05-23 17:07:45.449511
updated_at2023-11-11 09:22:21.239043
descriptionAsynchronous access to a bincode-encoded item stream.
homepagehttps://github.com/jonhoo/async-bincode
repositoryhttps://github.com/jonhoo/async-bincode.git
max_upload_size
id66809
size55,372
Bertie (github:cryspen:bertie)

documentation

README

async-bincode

Crates.io Documentation

Asynchronous access to a bincode-encoded item stream.

This crate enables you to asynchronously read from a bincode-encoded stream, or write bincoded-encoded values. bincode does not support this natively, as it cannot easily resume from stream errors while encoding or decoding.

async-bincode works around that on the receive side by buffering received bytes until a full element's worth of data has been received, and only then calling into bincode. To make this work, it relies on the sender to prefix each encoded element with its encoded size.

On the write side, async-bincode buffers the serialized values, and asynchronously sends the resulting bytestream. Important: Only one element at a time is written to the output writer. It is recommended to use a BufWriter in front of the output to batch write operations to the underlying writer. The marker trait AsyncDestination can be used to automatically add the length prefix required by an async-bincode receiver.

Commit count: 123

cargo fmt