3 releases (stable)

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

#2149 in Procedural macros

Download history 14838/week @ 2024-07-25 19256/week @ 2024-08-01 16365/week @ 2024-08-08 15566/week @ 2024-08-15 15938/week @ 2024-08-22 19005/week @ 2024-08-29 20101/week @ 2024-09-05 20399/week @ 2024-09-12 18758/week @ 2024-09-19 17970/week @ 2024-09-26 14357/week @ 2024-10-03 21612/week @ 2024-10-10 27534/week @ 2024-10-17 18242/week @ 2024-10-24 13379/week @ 2024-10-31 11010/week @ 2024-11-07

74,690 downloads per month
Used in 182 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
~37K SLoC