File tree 3 files changed +33
-8
lines changed
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/).
7
7
8
8
## [ Unreleased]
9
9
10
+ ## [ v0.6.0] - 2024-08-07
11
+
10
12
### Breaking
11
13
- MSRV is now ` 1.65.0 ` .
12
14
@@ -16,7 +18,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
16
18
error types when using tools like ` probe-rs ` for logging over debuggers.
17
19
- Implement ` Serializer::collect_str `
18
20
- 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 ` .
20
22
21
23
### Changed
22
24
@@ -91,7 +93,8 @@ error types when using tools like `probe-rs` for logging over debuggers.
91
93
92
94
Initial release
93
95
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
95
98
[ v0.5.1 ] : https://github.com/rust-embedded-community/serde-json-core/compare/v0.5.0...v0.5.1
96
99
[ v0.5.0 ] : https://github.com/rust-embedded-community/serde-json-core/compare/v0.4.0...v0.5.0
97
100
[ 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 1
1
[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
+ ]
3
7
categories = [" no-std" ]
4
8
description = " serde-json for no_std programs"
5
9
documentation = " https://docs.rs/serde-json-core"
@@ -10,7 +14,7 @@ license = "MIT OR Apache-2.0"
10
14
name = " serde-json-core"
11
15
readme = " README.md"
12
16
repository = " https://github.com/rust-embedded-community/serde-json-core"
13
- version = " 0.5.1 "
17
+ version = " 0.6.0 "
14
18
15
19
[dependencies ]
16
20
ryu = " 1.0.5"
Original file line number Diff line number Diff line change 5
5
//! This version of [`serde-json`] is aimed at applications that run on resource constrained
6
6
//! devices.
7
7
//!
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
+ //!
8
29
//! # Current features
9
30
//!
10
31
//! - The error type is a simple C like enum (less overhead, smaller memory footprint)
16
37
//! - `bool`
17
38
//! - Integers
18
39
//! - Floats
19
- //! - `str` (This is a zero copy operation.) (\* )
40
+ //! - `str` (This is a zero copy operation when deserializing without de-escaping strings. )
20
41
//! - `Option`
21
42
//! - Arrays
22
43
//! - Tuples
33
54
//! - Structs
34
55
//! - C like enums
35
56
//!
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
- //!
39
57
//! (\*\*) Serialization of strings doesn't escape stuff. This simply has not been implemented yet.
40
58
//!
41
59
//! # Planned features
You can’t perform that action at this time.
0 commit comments