serde_tuple

Crates.ioserde_tuple
lib.rsserde_tuple
version1.1.0
sourcesrc
created_at2019-01-30 18:50:43.618616
updated_at2024-11-14 02:19:29.215477
descriptionDe/serialize structs with named fields as array of values
homepage
repositoryhttps://github.com/kardeiz/serde_tuple
max_upload_size
id111679
size17,657
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: 35

cargo fmt