28 releases

new 0.1.33 Jan 23, 2025
0.1.32 Jan 20, 2025
0.1.31 Nov 12, 2024
0.1.28 Aug 6, 2024
0.1.4 Apr 25, 2024

#1019 in Encoding

Download history 2/week @ 2024-10-08 3/week @ 2024-10-15 11/week @ 2024-10-22 142/week @ 2024-10-29 40/week @ 2024-11-05 259/week @ 2024-11-12 57/week @ 2024-11-19 20/week @ 2024-11-26 21/week @ 2024-12-03 55/week @ 2024-12-10 20/week @ 2024-12-17 9/week @ 2025-01-07 66/week @ 2025-01-14 167/week @ 2025-01-21

242 downloads per month
Used in 3 crates (2 directly)

MIT/Apache

64KB
1.5K SLoC

derse

Rust Crates.io Version codecov

A simple binary serialization protocol for Rust.

Usage

To use this library, add the following to your Cargo.toml:

[dependencies]
derse = "0.1"

Then, you can import and use the components as follows:

use derse::{Deserialize, DownwardBytes, Serialize};

// 1. serialization for basic types.
let ser = "hello world!";
let bytes = ser.serialize::<DownwardBytes>().unwrap();
let der = String::deserialize(&bytes[..]).unwrap();
assert_eq!(ser, der);

// 2. serialization for custom structs.
#[derive(Debug, Default, Deserialize, Serialize, PartialEq)]
pub struct Demo {
    a: i32,
    b: String,
    c: Vec<String>,
}
let ser = Demo::default();
let bytes = ser.serialize::<DownwardBytes>().unwrap();
let der = Demo::deserialize(&bytes[..]).unwrap();
assert_eq!(ser, der);

Dependencies

~1.3–2.1MB
~45K SLoC