pub struct DuplicateKeyRejectingJsonValue(/* private fields */);Expand description
A JSON value whose deserialization rejects duplicate object keys.
This wrapper is useful for document formats where accepting the usual
last-key-wins object behavior would make the input ambiguous. It preserves
serde_json’s standard i64, u64, and finite f64 number representation
while recursively validating every object. For raw JSON text, use
crate::decode::JsonDecoder when the crate’s explicit numeric range
contract must be enforced before deserialization.
§Examples
use qubit_json::value::DuplicateKeyRejectingJsonValue;
let value: DuplicateKeyRejectingJsonValue = serde_json::from_str(r#"{"ok":true}"#)?;
assert_eq!(value.into_inner()["ok"], true);Implementations§
Source§impl DuplicateKeyRejectingJsonValue
impl DuplicateKeyRejectingJsonValue
Sourcepub fn into_inner(self) -> Value
pub fn into_inner(self) -> Value
Returns the validated JSON value.
§Returns
The owned serde_json value constructed during deserialization.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for DuplicateKeyRejectingJsonValue
impl<'de> Deserialize<'de> for DuplicateKeyRejectingJsonValue
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserializes JSON recursively while rejecting duplicate object keys.
impl StructuralPartialEq for DuplicateKeyRejectingJsonValue
Auto Trait Implementations§
impl Freeze for DuplicateKeyRejectingJsonValue
impl RefUnwindSafe for DuplicateKeyRejectingJsonValue
impl Send for DuplicateKeyRejectingJsonValue
impl Sync for DuplicateKeyRejectingJsonValue
impl Unpin for DuplicateKeyRejectingJsonValue
impl UnsafeUnpin for DuplicateKeyRejectingJsonValue
impl UnwindSafe for DuplicateKeyRejectingJsonValue
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more