deser: an experimental serialization and deserialization library for Rust
[![Crates.io](https://img.shields.io/crates/d/deser.svg)](https://crates.io/crates/deser)
[![License](https://img.shields.io/github/license/mitsuhiko/deser)](https://github.com/mitsuhiko/deser/blob/main/LICENSE)
[![Documentation](https://docs.rs/deser/badge.svg)](https://docs.rs/deser)
Deser is an experimental serialization system for Rust. It wants to explore the
possibilities of serialization and deserialization of structural formats such as
JSON or msgpack. It intentionally does not desire to support non self
describing formats such as bincode.
**This is not a production ready yet.**
```rust
use deser::{Serialize, Deserialize};
#[derive(Debug, Serialize, Deserialize)]
#[deser(rename_all = "camelCase")]
pub struct Account {
id: usize,
account_holder: String,
is_deactivated: bool,
}
```
This generates out the necessary
[`Serialize`](https://docs.rs/deser/latest/deser/ser/trait.Serialize.html) and
[`Deserialize`](https://docs.rs/deser/latest/deser/de/trait.Deserialize.html)
implementations.
To see some practical examples of this have a look at the
[examples](https://github.com/mitsuhiko/deser/tree/main/examples).
## Design Goals
* **Fast Compile Times:** deser avoids excessive monomorphization by encouraging
dynamic dispatch. The goal is to avoid generating a lot of duplicate code that
produces bloat the compiler needs to churn through.
* **Simple Data Model:** deser simplifies the data model on the serialization
and deserialization interface. For instance instead of making a distinction
between `u8` and `u64` they are represented the same in the model. To compensate
for this, it provides type descriptors that provide auxiliary information for
when a serializer wants to process it. This helps with compile times and makes
using the crate easier.
* **Native Bytes Support:** deser has built-in specialization for serializing
bytes and byte vectors. A `Vec