#miniserde #derive #serialization #deserialize #serde #minus #microserde

macro microserde-derive

Derive macros for microserde. Use the re-exports from the microserde crate instead.

1 unstable release

0.1.13 Jan 5, 2021

#7 in #miniserde

Download history 147/week @ 2023-12-18 140/week @ 2023-12-25 24/week @ 2024-01-01 51/week @ 2024-01-08 27/week @ 2024-01-15 18/week @ 2024-01-22 29/week @ 2024-01-29 90/week @ 2024-02-05 84/week @ 2024-02-12 96/week @ 2024-02-19 148/week @ 2024-02-26 142/week @ 2024-03-04 137/week @ 2024-03-11 103/week @ 2024-03-18 69/week @ 2024-03-25 141/week @ 2024-04-01

465 downloads per month
Used in 11 crates (via microserde)

MIT/Apache

17KB
375 lines

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
~34K SLoC