1 unstable release

0.1.13 Jan 5, 2021

#2059 in Encoding

Download history 22/week @ 2024-07-22 25/week @ 2024-07-29 76/week @ 2024-08-05 29/week @ 2024-08-12 23/week @ 2024-08-19 86/week @ 2024-08-26 16/week @ 2024-09-02 26/week @ 2024-09-09 17/week @ 2024-09-16 68/week @ 2024-09-23 33/week @ 2024-09-30 20/week @ 2024-10-07 18/week @ 2024-10-14 29/week @ 2024-10-21 32/week @ 2024-10-28 17/week @ 2024-11-04

97 downloads per month
Used in 10 crates (4 directly)

MIT/Apache

87KB
2K SLoC

Microserde

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 functionality
  • itoa crate is replaced with stdlib functionality
  • serde crate is removed from dev-dependencies
[dependencies]
microserde = "0.1"

Example

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(())
}

License

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.

Dependencies

~1.5MB
~37K SLoC