Skip to main content

Parser

Struct Parser 

Source
pub struct Parser<R> {
    pub read: R,
    /* private fields */
}

Fields§

§read: R

Implementations§

Source§

impl<'de, R> Parser<R>
where R: Reader<'de>,

Source

pub fn new(read: R) -> Self

Source

pub fn offset(&self) -> usize

Source

pub fn utf8_lossy(self) -> Self

Enable lossy UTF-8 handling: invalid surrogates produce U+FFFD replacement chars instead of errors. Matches Go’s encoding/json behavior.

Source

pub fn error(&self, reason: ErrorCode) -> Error

Error caused by a byte from next_char().

Source

pub fn parse_number(&mut self, first: u8) -> Result<ParserNumber>

Source

pub fn parse_str<'own>( &mut self, buf: &'own mut Vec<u8>, ) -> Result<Reference<'de, 'own, str>>

Source

pub fn skip_space(&mut self) -> Option<u8>

Source

pub fn skip_space_peek(&mut self) -> Option<u8>

Source

pub fn parse_literal(&mut self, literal: &str) -> Result<()>

Source

pub fn skip_number(&mut self, first: u8) -> Result<&'de str>

Source

pub fn skip_one(&mut self, checked: bool) -> Result<(&'de [u8], ParseStatus)>

Source

pub fn peek_invalid_type(&mut self, peek: u8, exp: &dyn Expected) -> Error

Source§

impl<'de, R> Parser<R>
where R: Reader<'de>,

Source

pub fn get_by_schema(&mut self, schema: &mut Value) -> Result<()>

Auto Trait Implementations§

§

impl<R> Freeze for Parser<R>
where R: Freeze,

§

impl<R> RefUnwindSafe for Parser<R>
where R: RefUnwindSafe,

§

impl<R> Send for Parser<R>
where R: Send,

§

impl<R> Sync for Parser<R>
where R: Sync,

§

impl<R> Unpin for Parser<R>
where R: Unpin,

§

impl<R> UnsafeUnpin for Parser<R>
where R: UnsafeUnpin,

§

impl<R> UnwindSafe for Parser<R>
where R: 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.