JsonParser

Struct JsonParser 

Source
pub struct JsonParser<'de> { /* private fields */ }
Expand description

Streaming JSON parser backed by facet-json’s SliceAdapter.

Implementations§

Source§

impl<'de> JsonParser<'de>

Source

pub fn new(input: &'de [u8]) -> Self

Trait Implementations§

Source§

impl<'de> FormatParser<'de> for JsonParser<'de>

Source§

type Error = JsonError

Parser-specific error type.
Source§

type Probe<'a> = JsonProbe<'de> where Self: 'a

Evidence cursor type produced by FormatParser::begin_probe.
Source§

fn raw_capture_shape(&self) -> Option<&'static Shape>

Returns the shape of the format’s raw capture type (e.g., RawJson::SHAPE). Read more
Source§

fn next_event(&mut self) -> Result<Option<ParseEvent<'de>>, Self::Error>

Read the next parse event, or None if the input is exhausted. Read more
Source§

fn peek_event(&mut self) -> Result<Option<ParseEvent<'de>>, Self::Error>

Peek at the next event without consuming it, or None if at EOF.
Source§

fn skip_value(&mut self) -> Result<(), Self::Error>

Skip the current value (for unknown fields, etc.).
Source§

fn begin_probe(&mut self) -> Result<Self::Probe<'_>, Self::Error>

Begin evidence collection for untagged-enum resolution.
Source§

fn capture_raw(&mut self) -> Result<Option<&'de str>, Self::Error>

Capture the raw representation of the current value without parsing it. Read more
Source§

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)

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)

Hint to the parser what scalar type is expected next. Read more
Source§

fn hint_sequence(&mut self)

Hint to the parser that a sequence (array/Vec) is expected. Read more
Source§

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)

Hint to the parser that an Option<T> is expected. Read more
Source§

fn hint_map(&mut self)

Hint to the parser that a map is expected. Read more
Source§

fn hint_enum(&mut self, _variants: &[EnumVariantHint])

Hint to the parser that an enum is expected, providing variant information. Read more
Source§

fn hint_opaque_scalar( &mut self, _type_identifier: &'static str, _shape: &'static Shape, ) -> bool

Hint to the parser that an opaque scalar type is expected. Read more
Source§

fn current_span(&self) -> Option<Span>

Returns the source span of the most recently consumed event. Read more

Auto Trait Implementations§

§

impl<'de> Freeze for JsonParser<'de>

§

impl<'de> RefUnwindSafe for JsonParser<'de>

§

impl<'de> Send for JsonParser<'de>

§

impl<'de> Sync for JsonParser<'de>

§

impl<'de> Unpin for JsonParser<'de>

§

impl<'de> UnwindSafe for JsonParser<'de>

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.