pub struct OpaqueValue(/* private fields */);Expand description
An immutable opaque JSON value carried by a response or event.
Received values retain their original JSON token. Locally constructed
Values keep serde_json’s normal serialization. Parsing is explicit and
fallible; no parsed view or caller buffer is retained alongside the token.
Implementations§
Source§impl OpaqueValue
impl OpaqueValue
Sourcepub fn to_value(&self) -> Result<Value>
pub fn to_value(&self) -> Result<Value>
Return an independent parsed value, without changing this token.
Received numbers can exceed serde_json’s representable range, so this operation can fail even though decode and re-encode remain valid.
Sourcepub fn received_json(&self) -> Option<&str>
pub fn received_json(&self) -> Option<&str>
The original JSON token for a received value; None for local values.
Trait Implementations§
Source§impl Clone for OpaqueValue
impl Clone for OpaqueValue
Source§impl Debug for OpaqueValue
impl Debug for OpaqueValue
Source§impl<'de> Deserialize<'de> for OpaqueValue
impl<'de> Deserialize<'de> for OpaqueValue
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<Value> for OpaqueValue
impl From<Value> for OpaqueValue
Source§impl PartialEq for OpaqueValue
impl PartialEq for OpaqueValue
Auto Trait Implementations§
impl Forget for OpaqueValue
impl Freeze for OpaqueValue
impl RefUnwindSafe for OpaqueValue
impl Send for OpaqueValue
impl Sync for OpaqueValue
impl Unpin for OpaqueValue
impl UnsafeUnpin for OpaqueValue
impl UnwindSafe for OpaqueValue
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