pub enum Reader<'data, 'tokens, E> {
Object(ObjectReader<'data, 'tokens, E>),
Array(ArrayReader<'data, 'tokens, E>),
Scalar(ScalarReader<'data, E>),
Value(ValueReader<'data, 'tokens, E>),
}Expand description
All possible text reader variants
Variants
Object(ObjectReader<'data, 'tokens, E>)
object reader
Array(ArrayReader<'data, 'tokens, E>)
array reader
Scalar(ScalarReader<'data, E>)
scalar reader
Value(ValueReader<'data, 'tokens, E>)
value reader
Implementations
sourceimpl<'data, 'tokens, E> Reader<'data, 'tokens, E> where
E: Encoding + Clone,
impl<'data, 'tokens, E> Reader<'data, 'tokens, E> where
E: Encoding + Clone,
sourcepub fn read_str(&self) -> Result<Cow<'data, str>, DeserializeError>
pub fn read_str(&self) -> Result<Cow<'data, str>, DeserializeError>
Interpret value as a string
sourcepub fn read_string(&self) -> Result<String, DeserializeError>
pub fn read_string(&self) -> Result<String, DeserializeError>
Interpret value as a string
sourcepub fn read_scalar(&self) -> Result<Scalar<'data>, DeserializeError>
pub fn read_scalar(&self) -> Result<Scalar<'data>, DeserializeError>
Interpret value as a scalar
Trait Implementations
Auto Trait Implementations
impl<'data, 'tokens, E> RefUnwindSafe for Reader<'data, 'tokens, E> where
E: RefUnwindSafe,
impl<'data, 'tokens, E> Send for Reader<'data, 'tokens, E> where
E: Send,
impl<'data, 'tokens, E> Sync for Reader<'data, 'tokens, E> where
E: Sync,
impl<'data, 'tokens, E> Unpin for Reader<'data, 'tokens, E> where
E: Unpin,
'data: 'tokens,
impl<'data, 'tokens, E> UnwindSafe for Reader<'data, 'tokens, E> where
E: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more