#stream #streaming #serialize #deserialize


Library for async stream (de)serialization

16 releases

0.6.3 Feb 15, 2023
0.5.2 Oct 15, 2022
0.5.0 Jul 5, 2021
0.3.0 Feb 1, 2021

#601 in Encoding

Download history 38/week @ 2022-11-27 66/week @ 2022-12-04 86/week @ 2022-12-11 66/week @ 2022-12-18 56/week @ 2022-12-25 27/week @ 2023-01-01 69/week @ 2023-01-08 48/week @ 2023-01-15 118/week @ 2023-01-22 94/week @ 2023-01-29 75/week @ 2023-02-05 166/week @ 2023-02-12 151/week @ 2023-02-19 248/week @ 2023-02-26 64/week @ 2023-03-05 57/week @ 2023-03-12

525 downloads per month
Used in 14 crates (13 directly)


1.5K SLoC


Rust library for asynchronous stream (de)serialization


Provides traits [FromStream], [Decoder], [ToStream] and [Encoder], which are streaming/async analogues of serde's Deserialize, Deserializer, Serialize, and Serializer.

The structure and contents of this crate are based on serde but not compatible with it (primarily because serde doesn't support async). Most of the code which makes up destream is copied directly from serde with minimal modifications.

serde is dual-licensed under the MIT and Apache-2.0 licenses, which are available at https://github.com/serde-rs/serde/blob/master/LICENSE-MIT and https://github.com/serde-rs/serde/blob/master/LICENSE-APACHE respectively.

Important differences between destream and serde:

  • destream supports decoding from and encoding to a futures::Stream (obviously).
  • destream does not (yet) support the derive macro, so you can't derive FromStream or ToStream, and there is no built-in functionality for decoding/encoding a given struct.
  • Decoder assumes the static lifetime and only supports owned types, but Encoder uses a specific lifetime 'en. This is the opposite of serde.

destream itself does not implement support for any specific serialization format. destream_json provides support for streaming JSON.


~51K SLoC