#ron #json

nanoserde

Fork of makepad-tinyserde without any external dependencies. Supports json, binary and ron. #[derive(Clone, Debug, Default, DeJson, SerJson)] pub struct Property { pub name: String, #[nserde(default)] pub value: String, #[nserde(rename = "type")] pub ty: String, }

33 releases

0.1.35 Sep 1, 2023
0.1.33 Jul 22, 2023
0.1.32 Nov 12, 2022
0.1.30 Jun 9, 2022
0.1.18 Jul 20, 2020

#95 in Encoding

Download history 1130/week @ 2023-06-06 1424/week @ 2023-06-13 1402/week @ 2023-06-20 1243/week @ 2023-06-27 1336/week @ 2023-07-04 1204/week @ 2023-07-11 1325/week @ 2023-07-18 1526/week @ 2023-07-25 1214/week @ 2023-08-01 1369/week @ 2023-08-08 1663/week @ 2023-08-15 1848/week @ 2023-08-22 1573/week @ 2023-08-29 2015/week @ 2023-09-05 1635/week @ 2023-09-12 1493/week @ 2023-09-19

6,946 downloads per month
Used in 32 crates (26 directly)

MIT/Apache

115KB
3.5K SLoC

nanoserde

Github Actions Crates.io version Documentation Discord chat

Fork of https://crates.io/crates/makepad-tinyserde with all the dependencies removed. No more syn, proc_macro2 or quote in the build tree!

> cargo tree
nanoserde v0.1.0 (/../nanoserde)
└── nanoserde-derive v0.1.0 (/../nanoserde/derive)

Example:

use nanoserde::{DeJson, SerJson};

#[derive(Clone, Debug, Default, DeJson, SerJson)]
pub struct Property {
    pub name: String,
    #[nserde(default)]
    pub value: String,
    #[nserde(rename = "type")]
    pub ty: String,
}

For more examples take a look at tests

Features support matrix:

Feature json bin ron toml
serialization yes yes yes no
deserialization yes yes yes no
container: Struct yes yes yes no
container: Tuple Struct no yes yes no
container: Enum yes yes yes no
field: std::collections::HashMap yes yes yes no
field: std::vec::Vec yes yes yes no
field: Option yes yes yes no
field: i*/f*/String/T: De*/Ser* yes yes yes no
field attribute: #[nserde(default)] yes no yes no
field attribute: #[nserde(rename = "")] yes yes yes no
field attribute: #[nserde(proxy = "")] no yes no no
container attribute: #[nserde(default)] yes no yes no
container attribute: #[nserde(rename = "")] yes yes yes no
container attribute: #[nserde(proxy = "")] yes yes no no
container attribute: #[nserde(transparent)] yes no no no

Dependencies

~175KB