pub struct BufferedValue(pub Value);Available on crate feature
json only.Expand description
A serde_json::Value, deserialized with every object key read as data.
The wrapper selects the Deserialize impl and carries no invariant: any
Value can be wrapped. It accepts the input that Value accepts, and
builds the same Value except in two cases:
- An object with the key
$serde_json::private::RawValuestays an object. - In a build with
serde_json’sarbitrary_precisionfeature, a number that has a fraction or an exponent, or that is outside thei64andu64ranges, buffers as an object and not as a number.
The module documentation explains both.
§Examples
use buffa::json_helpers::buffered::BufferedValue;
let text = r#"{"$serde_json::private::RawValue": "[1, 2]"}"#;
let BufferedValue(value) = serde_json::from_str(text)?;
assert_eq!(value["$serde_json::private::RawValue"], "[1, 2]");Tuple Fields§
§0: ValueTrait Implementations§
Source§impl Clone for BufferedValue
impl Clone for BufferedValue
Source§impl Debug for BufferedValue
impl Debug for BufferedValue
Source§impl<'de> Deserialize<'de> for BufferedValue
impl<'de> Deserialize<'de> for BufferedValue
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<BufferedValue> for Value
impl From<BufferedValue> for Value
Source§fn from(BufferedValue: BufferedValue) -> Self
fn from(BufferedValue: BufferedValue) -> Self
Converts to this type from the input type.
Source§impl PartialEq for BufferedValue
impl PartialEq for BufferedValue
impl StructuralPartialEq for BufferedValue
Auto Trait Implementations§
impl Forget for BufferedValue
impl Freeze for BufferedValue
impl Move for BufferedValue
impl RefUnwindSafe for BufferedValue
impl Send for BufferedValue
impl Sync for BufferedValue
impl Unpin for BufferedValue
impl UnsafeUnpin for BufferedValue
impl UnwindSafe for BufferedValue
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