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>
impl<'a, 'c> JsonReader<'a, 'c>
pub fn new( input: &'a str, memory: &MemoryBudget, cancellation: &'c CancellationToken, ) -> Self
pub fn from_slice( input: &'a [u8], memory: &MemoryBudget, cancellation: &'c CancellationToken, ) -> Self
Sourcepub fn with_control(input: &'a str, control: &ProductionControl<'c>) -> Self
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.
Sourcepub fn with_depth_limit(self, limit: usize) -> Self
pub fn with_depth_limit(self, limit: usize) -> Self
Limit open containers for formats whose previous decoder imposed a nesting limit.
Sourcepub fn with_ignored_string_escapes(self) -> Self
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.
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> 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