15 releases (5 stable)
| 1.1.3 | Nov 1, 2025 |
|---|---|
| 1.1.2 | Jul 15, 2025 |
| 1.1.0 | Nov 14, 2024 |
| 0.5.0 | Mar 20, 2020 |
| 0.2.2 | Mar 6, 2019 |
#80 in Encoding
99,025 downloads per month
Used in 254 crates
(48 directly)
24KB
480 lines
serde_tuple
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 withcargo 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.
Dependencies
~0.3–1MB
~21K SLoC