24 releases
| new 0.10.1 | Jan 30, 2026 |
|---|---|
| 0.9.0 | Feb 17, 2025 |
| 0.8.0 | Aug 13, 2024 |
| 0.7.3 | Dec 20, 2023 |
| 0.3.0 | Feb 1, 2021 |
#794 in Encoding
107 downloads per month
Used in 27 crates
(26 directly)
90KB
1.5K
SLoC
destream
Rust library for asynchronous stream (de)serialization
lib.rs:
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:
destreamsupports decoding from and encoding to afutures::Stream(obviously).destreamdoes not (yet) support thederivemacro, so you can't deriveFromStreamorToStream, and there is no built-in functionality for decoding/encoding a givenstruct.Decoderassumes the static lifetime and only supports owned types, butEncoderuses a specific lifetime'en. This is the opposite ofserde.
destream itself does not implement support for any specific serialization format.
destream_json provides support for streaming JSON.
Dependencies
~1.3–2MB
~39K SLoC