3 releases (stable)

1.0.1 Nov 14, 2024
1.0.0 Sep 14, 2024
0.5.0 Mar 20, 2020

#2500 in Procedural macros

Download history 16710/week @ 2024-10-08 26488/week @ 2024-10-15 22429/week @ 2024-10-22 15193/week @ 2024-10-29 12402/week @ 2024-11-05 11768/week @ 2024-11-12 10083/week @ 2024-11-19 12381/week @ 2024-11-26 15597/week @ 2024-12-03 17891/week @ 2024-12-10 16233/week @ 2024-12-17 9973/week @ 2024-12-24 10739/week @ 2024-12-31 16686/week @ 2025-01-07 14276/week @ 2025-01-14 13134/week @ 2025-01-21

56,604 downloads per month
Used in 183 crates (via serde_tuple)

MIT license

8KB
159 lines

serde_tuple

De/serialize structs with named fields as array of values.

See: https://github.com/dtolnay/request-for-implementation/issues/3

Usage

use serde_tuple::*;

#[derive(Serialize_tuple, Deserialize_tuple)]
pub struct Foo<'a> {
    bar: &'a str,
    baz: i32
}

let foo = Foo { bar: "Yes", baz: 22 };
let json = serde_json::to_string(&foo).unwrap();
println!("{}", &json);
// # => ["Yes",22]

License: MIT

Dependencies

~1.5MB
~38K SLoC