#asynchronous #tokio #bincode #serialization

async-bincode

Asynchronous access to a bincode-encoded item stream

23 releases

0.6.1 Feb 25, 2021
0.5.1 Nov 27, 2019
0.4.9 Dec 6, 2018
0.4.5 Jul 9, 2018

#121 in Encoding

Download history 55/week @ 2020-12-22 52/week @ 2020-12-29 90/week @ 2021-01-05 147/week @ 2021-01-12 150/week @ 2021-01-19 316/week @ 2021-01-26 196/week @ 2021-02-02 251/week @ 2021-02-09 265/week @ 2021-02-16 202/week @ 2021-02-23 298/week @ 2021-03-02 225/week @ 2021-03-09 284/week @ 2021-03-16 464/week @ 2021-03-23 587/week @ 2021-03-30 476/week @ 2021-04-06

715 downloads per month
Used in 9 crates (6 directly)

MIT/Apache

24KB
443 lines

async-bincode

Crates.io Documentation Build Status

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. See [serialize_into] for a convenience method that provides this.

On the write side, async-bincode buffers the serialized values, and asynchronously sends the resulting bytestream.

Dependencies

~3MB
~50K SLoC