serde_tuple

Crates.ioserde_tuple
lib.rsserde_tuple
version1.1.2
created_at2019-01-30 18:50:43.618616+00
updated_at2025-07-15 13:36:53.243472+00
descriptionDe/serialize structs with named fields as array of values
homepage
repositoryhttps://github.com/kardeiz/serde_tuple
max_upload_size
id111679
size34,425
Jacob Brown (kardeiz)

documentation

README

serde_tuple

GitHub repo crates.io version docs.rs status crates.io license CI build status Codecov

Serialize and deserialize structs with named fields as an array of values using Derive macros.

Usage

use serde_tuple::*;

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

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

See also this issue

Development

  • This project is easier to develop with just, a modern alternative to make. Install it with cargo install just.
  • To get a list of available commands, run just.
  • To run tests, use just test.

License

Licensed under MIT license (LICENSE or https://opensource.org/licenses/MIT) at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual-licensed as above, without any additional terms or conditions.

Commit count: 43

cargo fmt