Skip to main content

JsonReader

Struct JsonReader 

Source
pub struct JsonReader<'a, 'c> { /* private fields */ }
Expand description

Iterative structural decoding charges its nesting stack before allocation. Event payloads borrow the input; consumers own and charge their chosen value representation separately.

Implementations§

Source§

impl<'a, 'c> JsonReader<'a, 'c>

Source

pub fn new( input: &'a str, memory: &MemoryBudget, cancellation: &'c CancellationToken, ) -> Self

Source

pub fn from_slice( input: &'a [u8], memory: &MemoryBudget, cancellation: &'c CancellationToken, ) -> Self

Source

pub fn with_control(input: &'a str, control: &ProductionControl<'c>) -> Self

Read the same borrowed grammar under an ordinary or controlled producer, preserving every active cancellation owner within token scans as well as between events.

Source

pub fn with_depth_limit(self, limit: usize) -> Self

Limit open containers for formats whose previous decoder imposed a nesting limit.

Source

pub fn with_ignored_string_escapes(self) -> Self

Match serde’s ignored-value byte validation when locating fields in a durable envelope: require four hexadecimal digits after each Unicode escape, without decoding UTF-8 or requiring surrogate pairs in discarded strings. Consumers must decode retained keys and string values with their ordinary strict decoder.

Source

pub fn next_event(&mut self) -> Result<Option<JsonEvent<'a>>, JsonReadError>

Auto Trait Implementations§

§

impl<'a, 'c> Freeze for JsonReader<'a, 'c>

§

impl<'a, 'c> RefUnwindSafe for JsonReader<'a, 'c>

§

impl<'a, 'c> Send for JsonReader<'a, 'c>

§

impl<'a, 'c> Sync for JsonReader<'a, 'c>

§

impl<'a, 'c> Unpin for JsonReader<'a, 'c>

§

impl<'a, 'c> UnsafeUnpin for JsonReader<'a, 'c>

§

impl<'a, 'c> UnwindSafe for JsonReader<'a, 'c>

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.