serde_tuple_macros

Crates.ioserde_tuple_macros
lib.rsserde_tuple_macros
version1.0.0
sourcesrc
created_at2020-03-20 18:50:57.387278
updated_at2024-09-14 19:12:11.737752
descriptionDe/serialize structs with named fields as array of values
homepage
repositoryhttps://github.com/kardeiz/serde_tuple
max_upload_size
id220765
size8,777
Jacob Brown (kardeiz)

documentation

README

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

Commit count: 26

cargo fmt