pub struct Deserializer<'read, R: Read<'read>, S: Stack> { /* private fields */ }Expand description
A deserializer for a JSON-encoded structure.
Implementations§
Source§impl<'read, R: Read<'read>, S: Stack> Deserializer<'read, R, S>
impl<'read, R: Read<'read>, S: Stack> Deserializer<'read, R, S>
Sourcepub fn new(reader: R) -> Result<Self, JsonError<'read, R, S>>
pub fn new(reader: R) -> Result<Self, JsonError<'read, R, S>>
Create a new deserializer.
This will advance past any whitespace present at the start of the reader, per RFC 8259’s definition of whitespace.
If reader is aligned to valid JSON, this will read past the immediately present structure
yet no further. If reader is not aligned to valid JSON, the state of reader is undefined
after this.
Sourcepub fn value(
&mut self,
) -> Result<Value<'read, '_, R, S>, JsonError<'read, R, S>>
pub fn value( &mut self, ) -> Result<Value<'read, '_, R, S>, JsonError<'read, R, S>>
Obtain the Value representing the serialized structure.
This takes a mutable reference as Deserializer is the owned object representing the
deserializer’s state. However, this is not eligible to be called more than once, even after
the initial mutable borrow is dropped. Multiple calls to this function will cause an error to
be returned.
Auto Trait Implementations§
impl<'read, R, S> Freeze for Deserializer<'read, R, S>
impl<'read, R, S> RefUnwindSafe for Deserializer<'read, R, S>where
S: RefUnwindSafe,
R: RefUnwindSafe,
<R as Read<'read>>::Error: RefUnwindSafe,
<S as Stack>::Error: RefUnwindSafe,
impl<'read, R, S> Send for Deserializer<'read, R, S>
impl<'read, R, S> Sync for Deserializer<'read, R, S>
impl<'read, R, S> Unpin for Deserializer<'read, R, S>
impl<'read, R, S> UnwindSafe for Deserializer<'read, R, S>where
S: UnwindSafe,
R: UnwindSafe,
<R as Read<'read>>::Error: UnwindSafe,
<S as Stack>::Error: UnwindSafe,
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