3 releases (stable)

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

#2400 in Procedural macros

Download history 19571/week @ 2024-09-06 19744/week @ 2024-09-13 19824/week @ 2024-09-20 17730/week @ 2024-09-27 13646/week @ 2024-10-04 24517/week @ 2024-10-11 26456/week @ 2024-10-18 16571/week @ 2024-10-25 12619/week @ 2024-11-01 13531/week @ 2024-11-08 9246/week @ 2024-11-15 10675/week @ 2024-11-22 15351/week @ 2024-11-29 17325/week @ 2024-12-06 16646/week @ 2024-12-13 11520/week @ 2024-12-20

62,602 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