enum Content<'de, 'a> {
Input(&'de str),
Slice(&'a str),
Owned(String, usize),
}
Expand description
Variants§
Input(&'de str)
An input borrowed from the parsed data
Slice(&'a str)
An input borrowed from the buffer owned by another deserializer
Owned(String, usize)
An input taken from an external deserializer, owned by that deserializer.
Only part of this data, located after offset represented by usize
, used
to deserialize data, the other is a garbage that can’t be dropped because
we do not want to make reallocations if they will not required.
Implementations§
Source§impl<'de, 'a> Content<'de, 'a>
impl<'de, 'a> Content<'de, 'a>
Sourcefn deserialize_all<V>(self, visitor: V) -> Result<V::Value, DeError>where
V: Visitor<'de>,
fn deserialize_all<V>(self, visitor: V) -> Result<V::Value, DeError>where
V: Visitor<'de>,
Supply to the visitor a borrowed string, a string slice, or an owned
string depending on the kind of input. Unlike Self::deserialize_item
,
the whole Self::Owned
string will be passed to the visitor.
Calls
visitor.visit_borrowed_str
if data borrowed from the inputvisitor.visit_str
if data borrowed from another sourcevisitor.visit_string
if data owned by this type
Sourcefn deserialize_item<V>(self, visitor: V) -> Result<V::Value, DeError>where
V: Visitor<'de>,
fn deserialize_item<V>(self, visitor: V) -> Result<V::Value, DeError>where
V: Visitor<'de>,
Supply to the visitor a borrowed string, a string slice, or an owned
string depending on the kind of input. Unlike Self::deserialize_all
,
only part of Self::Owned
string will be passed to the visitor.
Calls
visitor.visit_borrowed_str
if data borrowed from the inputvisitor.visit_str
if data borrowed from another sourcevisitor.visit_string
if data owned by this type