https://github.com/cloudhead/microserde
miniserde minus the dependencies
https://github.com/cloudhead/microserde
Last synced: 9 months ago
JSON representation
miniserde minus the dependencies
- Host: GitHub
- URL: https://github.com/cloudhead/microserde
- Owner: cloudhead
- License: apache-2.0
- Created: 2021-01-05T07:54:15.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-08-25T07:59:12.000Z (over 4 years ago)
- Last Synced: 2025-04-12T14:49:05.505Z (11 months ago)
- Language: Rust
- Size: 224 KB
- Stars: 19
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
Microserde
==========
Microserde is [miniserde](https://crates.io/crates/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](https://serde.rs).*
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*
```toml
[dependencies]
microserde = "0.1"
```
### Example
```rust
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.