Crates.io | microserde |
lib.rs | microserde |
version | 0.1.13 |
source | src |
created_at | 2021-01-05 12:56:53.960618 |
updated_at | 2021-01-05 12:56:53.960618 |
description | Zero-dependency implementation of Serde |
homepage | |
repository | https://github.com/cloudhead/microserde |
max_upload_size | |
id | 332090 |
size | 99,359 |
Microserde is miniserde minus the dependencies.
All credit goes to David Tolnay for the original library.
From miniserde:
Prototype of a data structure serialization library with several opposite design goals from Serde.
Differences compared to miniserde
:
ryu
crate is replaced with stdlib functionalityitoa
crate is replaced with stdlib functionalityserde
crate is removed from dev-dependencies[dependencies]
microserde = "0.1"
use microserde::{json, Serialize, Deserialize};
#[derive(Serialize, Deserialize, Debug)]
struct Example {
code: u32,
message: String,
}
fn main() -> microserde::Result<()> {
let example = Example {
code: 200,
message: "reminiscent of Serde".to_owned(),
};
let j = json::to_string(&example);
println!("{}", j);
let out: Example = json::from_str(&j)?;
println!("{:?}", out);
Ok(())
}
Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.