Deserializer

Struct Deserializer 

Source
pub struct Deserializer<'bytes, B: BytesLike<'bytes>, S: Stack> { /* private fields */ }
Expand description

A deserializer for a JSON-encoded structure.

Implementations§

Source§

impl<'bytes, B: BytesLike<'bytes>, S: Stack> Deserializer<'bytes, B, S>

Source

pub fn new(bytes: B) -> Result<Self, JsonError<'bytes, B, S>>

Create a new deserializer.

Source

pub fn value( &mut self, ) -> Result<Value<'bytes, '_, B, S>, JsonError<'bytes, B, 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<'bytes, B, S> Freeze for Deserializer<'bytes, B, S>
where B: Freeze, S: Freeze, <B as BytesLike<'bytes>>::Error: Freeze, <S as Stack>::Error: Freeze,

§

impl<'bytes, B, S> RefUnwindSafe for Deserializer<'bytes, B, S>

§

impl<'bytes, B, S> Send for Deserializer<'bytes, B, S>
where B: Send, S: Send, <B as BytesLike<'bytes>>::Error: Send, <S as Stack>::Error: Send,

§

impl<'bytes, B, S> Sync for Deserializer<'bytes, B, S>
where B: Sync, S: Sync, <B as BytesLike<'bytes>>::Error: Sync, <S as Stack>::Error: Sync,

§

impl<'bytes, B, S> Unpin for Deserializer<'bytes, B, S>
where B: Unpin, S: Unpin, <B as BytesLike<'bytes>>::Error: Unpin, <S as Stack>::Error: Unpin,

§

impl<'bytes, B, S> UnwindSafe for Deserializer<'bytes, B, S>
where B: UnwindSafe, S: UnwindSafe, <B as BytesLike<'bytes>>::Error: UnwindSafe, <S as Stack>::Error: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.