pub struct JsonParser<'de, const TRUSTED_UTF8: bool = false> { /* private fields */ }Expand description
JSON parser using Scanner directly (no adapter layer).
The const generic TRUSTED_UTF8 controls UTF-8 validation:
TRUSTED_UTF8=true: skip UTF-8 validation (input came from&str)TRUSTED_UTF8=false: validate UTF-8 (input came from&[u8])
Implementations§
Trait Implementations§
Source§impl<'de, const TRUSTED_UTF8: bool> FormatParser<'de> for JsonParser<'de, TRUSTED_UTF8>
impl<'de, const TRUSTED_UTF8: bool> FormatParser<'de> for JsonParser<'de, TRUSTED_UTF8>
Source§fn raw_capture_shape(&self) -> Option<&'static Shape>
fn raw_capture_shape(&self) -> Option<&'static Shape>
Returns the shape of the format’s raw capture type (e.g.,
RawJson::SHAPE). Read moreSource§fn next_event(&mut self) -> Result<Option<ParseEvent<'de>>, ParseError>
fn next_event(&mut self) -> Result<Option<ParseEvent<'de>>, ParseError>
Read the next parse event, or
None if the input is exhausted. Read moreSource§fn next_events(
&mut self,
buf: &mut VecDeque<ParseEvent<'de>>,
limit: usize,
) -> Result<usize, ParseError>
fn next_events( &mut self, buf: &mut VecDeque<ParseEvent<'de>>, limit: usize, ) -> Result<usize, ParseError>
Read multiple parse events into a deque, returning the number of events read. Read more
Source§fn save(&mut self) -> SavePoint
fn save(&mut self) -> SavePoint
Save the current parser position and start recording events. Read more
Source§fn restore(&mut self, save_point: SavePoint)
fn restore(&mut self, save_point: SavePoint)
Restore to a previous save point, replaying recorded events. Read more
Source§fn peek_event(&mut self) -> Result<Option<ParseEvent<'de>>, ParseError>
fn peek_event(&mut self) -> Result<Option<ParseEvent<'de>>, ParseError>
Peek at the next event without consuming it, or
None if at EOF.Source§fn skip_value(&mut self) -> Result<(), ParseError>
fn skip_value(&mut self) -> Result<(), ParseError>
Skip the current value (for unknown fields, etc.).
Source§fn capture_raw(&mut self) -> Result<Option<&'de str>, ParseError>
fn capture_raw(&mut self) -> Result<Option<&'de str>, ParseError>
Capture the raw representation of the current value without parsing it. Read more
Source§fn format_namespace(&self) -> Option<&'static str>
fn format_namespace(&self) -> Option<&'static str>
Returns the format namespace for format-specific proxy resolution. Read more
Source§fn current_span(&self) -> Option<Span>
fn current_span(&self) -> Option<Span>
Returns the source span of the most recently consumed event. Read more
Source§fn is_self_describing(&self) -> bool
fn is_self_describing(&self) -> bool
Returns true if this format is self-describing. Read more
Source§fn hint_struct_fields(&mut self, _num_fields: usize)
fn hint_struct_fields(&mut self, _num_fields: usize)
Hint to the parser that a struct with the given number of fields is expected. Read more
Source§fn hint_scalar_type(&mut self, _hint: ScalarTypeHint)
fn hint_scalar_type(&mut self, _hint: ScalarTypeHint)
Hint to the parser what scalar type is expected next. Read more
Source§fn hint_sequence(&mut self)
fn hint_sequence(&mut self)
Hint to the parser that a sequence (array/Vec) is expected. Read more
Source§fn hint_byte_sequence(&mut self) -> bool
fn hint_byte_sequence(&mut self) -> bool
Source§fn hint_remaining_byte_sequence(&mut self) -> bool
fn hint_remaining_byte_sequence(&mut self) -> bool
Hint to the parser that all remaining input bytes should be consumed as a byte slice. Read more
Source§fn hint_array(&mut self, _len: usize)
fn hint_array(&mut self, _len: usize)
Hint to the parser that a fixed-size array is expected. Read more
Source§fn hint_option(&mut self)
fn hint_option(&mut self)
Hint to the parser that an
Option<T> is expected. Read moreSource§fn hint_dynamic_value(&mut self)
fn hint_dynamic_value(&mut self)
Hint to the parser that a dynamic value is expected. Read more
Source§fn hint_enum(&mut self, _variants: &[EnumVariantHint])
fn hint_enum(&mut self, _variants: &[EnumVariantHint])
Hint to the parser that an enum is expected, providing variant information. Read more
Auto Trait Implementations§
impl<'de, const TRUSTED_UTF8: bool> Freeze for JsonParser<'de, TRUSTED_UTF8>
impl<'de, const TRUSTED_UTF8: bool> RefUnwindSafe for JsonParser<'de, TRUSTED_UTF8>
impl<'de, const TRUSTED_UTF8: bool> Send for JsonParser<'de, TRUSTED_UTF8>
impl<'de, const TRUSTED_UTF8: bool> Sync for JsonParser<'de, TRUSTED_UTF8>
impl<'de, const TRUSTED_UTF8: bool> Unpin for JsonParser<'de, TRUSTED_UTF8>
impl<'de, const TRUSTED_UTF8: bool> UnsafeUnpin for JsonParser<'de, TRUSTED_UTF8>
impl<'de, const TRUSTED_UTF8: bool> UnwindSafe for JsonParser<'de, TRUSTED_UTF8>
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