File tree Expand file tree Collapse file tree 3 files changed +33
-8
lines changed Expand file tree Collapse file tree 3 files changed +33
-8
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77
88## [ Unreleased]
99
10+ ## [ v0.6.0] - 2024-08-07
11+
1012### Breaking
1113- MSRV is now ` 1.65.0 ` .
1214
@@ -16,7 +18,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1618error types when using tools like ` probe-rs ` for logging over debuggers.
1719- Implement ` Serializer::collect_str `
1820- Derive ` Serialize ` for ` de::Error ` and ` ser::Error `
19- - Support for deserializing escaped strings.
21+ - Support for deserializing escaped strings using ` from_str_escaped ` and ` from_slice_escaped ` .
2022
2123### Changed
2224
@@ -91,7 +93,8 @@ error types when using tools like `probe-rs` for logging over debuggers.
9193
9294Initial release
9395
94- [ Unreleased ] : https://github.com/rust-embedded-community/serde-json-core/compare/v0.5.1...HEAD
96+ [ Unreleased ] : https://github.com/rust-embedded-community/serde-json-core/compare/v0.6.0...HEAD
97+ [ v0.6.0 ] : https://github.com/rust-embedded-community/serde-json-core/compare/v0.5.1...v0.6.0
9598[ v0.5.1 ] : https://github.com/rust-embedded-community/serde-json-core/compare/v0.5.0...v0.5.1
9699[ v0.5.0 ] : https://github.com/rust-embedded-community/serde-json-core/compare/v0.4.0...v0.5.0
97100[ v0.4.0 ] : https://github.com/rust-embedded-community/serde-json-core/compare/v0.3.0...v0.4.0
Original file line number Diff line number Diff line change 11[package ]
2- authors = [
" Jorge Aparicio <[email protected] >" ]
2+ authors = [
" Jorge Aparicio <[email protected] >" ,
3+ " Ryan Summers <[email protected] >" ,
4+ " Robert Jördens <[email protected] >" ,
5+ " Mathias Koch <[email protected] >" 6+ ]
37categories = [" no-std" ]
48description = " serde-json for no_std programs"
59documentation = " https://docs.rs/serde-json-core"
@@ -10,7 +14,7 @@ license = "MIT OR Apache-2.0"
1014name = " serde-json-core"
1115readme = " README.md"
1216repository = " https://github.com/rust-embedded-community/serde-json-core"
13- version = " 0.5.1 "
17+ version = " 0.6.0 "
1418
1519[dependencies ]
1620ryu = " 1.0.5"
Original file line number Diff line number Diff line change 55//! This version of [`serde-json`] is aimed at applications that run on resource constrained
66//! devices.
77//!
8+ //! ## Example
9+ //! ```
10+ //! # use serde::{Serialize, Deserialize};
11+ //! #[derive(Serialize, Deserialize)]
12+ //! struct Data<'a> {
13+ //! value: u32,
14+ //! message: &'a str,
15+ //! }
16+ //!
17+ //! // Serialized JSON data can be easily deserialized into Rust types.
18+ //! let message = b"{\"value\":10,\"message\":\"Hello, World!\"}";
19+ //! let (data, _remainder) = serde_json_core::from_slice::<Data<'_>>(message).unwrap();
20+ //! assert_eq!(data.value, 10);
21+ //! assert_eq!(data.message, "Hello, World!");
22+ //!
23+ //! // Structures can also be serialized into slices or strings.
24+ //! let mut deserialized = [0u8; 256];
25+ //! let len = serde_json_core::to_slice(&data, &mut deserialized[..]).unwrap();
26+ //! assert_eq!(&deserialized[..len], message);
27+ //! ```
28+ //!
829//! # Current features
930//!
1031//! - The error type is a simple C like enum (less overhead, smaller memory footprint)
1637//! - `bool`
1738//! - Integers
1839//! - Floats
19- //! - `str` (This is a zero copy operation.) (\* )
40+ //! - `str` (This is a zero copy operation when deserializing without de-escaping strings. )
2041//! - `Option`
2142//! - Arrays
2243//! - Tuples
3354//! - Structs
3455//! - C like enums
3556//!
36- //! (\*) Deserialization of strings ignores escaped sequences. Escaped sequences might be supported
37- //! in the future using a different Serializer as this operation is not zero copy.
38- //!
3957//! (\*\*) Serialization of strings doesn't escape stuff. This simply has not been implemented yet.
4058//!
4159//! # Planned features
You can’t perform that action at this time.
0 commit comments