pub struct RawValue { /* private fields */ }Expand description
Reference to a range of bytes encompassing a single valid JSON value in the input data.
Implementations§
source§impl RawValue
impl RawValue
sourcepub fn from_string(json: String) -> Result<Box<Self>, Error>
pub fn from_string(json: String) -> Result<Box<Self>, Error>
Convert an owned String of JSON data to an owned RawValue.
This function is equivalent to sonic_rs::from_str::<Box<RawValue>>
except that we avoid an allocation and memcpy if both of the following
are true:
- the input has no leading or trailing whitespace, and
- the input has capacity equal to its length.
pub fn from_json_str(json: &str) -> Result<&Self, Error>
Trait Implementations§
source§impl<'de: 'a, 'a> Deserialize<'de> for &'a RawValue
impl<'de: 'a, 'a> Deserialize<'de> for &'a RawValue
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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<'de> Deserialize<'de> for Box<RawValue>
impl<'de> Deserialize<'de> for Box<RawValue>
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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for RawValue
impl PartialEq for RawValue
source§impl PartialOrd for RawValue
impl PartialOrd for RawValue
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read more