[−][src]Struct rustc_serialize::json::Parser

pub struct Parser<T> {
    rdr: T,
    ch: Option<char>,
    line: usize,
    col: usize,
    stack: Stack,
    state: ParserState,
}

A streaming JSON parser implemented as an iterator of JsonEvent, consuming an iterator of char.

Fields

rdr: Tch: Option<char>line: usizecol: usizestack: Stackstate: ParserState

Implementations

impl<T: Iterator<Item = char>> Parser<T>[src]

pub fn new(rdr: T) -> Parser<T>ⓘ

Notable traits for Parser<T>

impl<T: Iterator<Item = char>> Iterator for Parser<T> type Item = JsonEvent;
[src]

Creates the JSON parser.

pub fn stack(&self) -> &Stack[src]

Provides access to the current position in the logical structure of the JSON stream.

pub(in json) fn eof(
    &self
) -> bool
[src]

pub(in json) fn ch_or_null(
    &self
) -> char
[src]

pub(in json) fn bump(
    &mut self
)
[src]

pub(in json) fn next_char(
    &mut self
) -> Option<char>
[src]

pub(in json) fn ch_is(
    &self,
    c: char
) -> bool
[src]

pub(in json) fn error<U>(
    &self,
    reason: ErrorCode
) -> Result<U, ParserError>
[src]

pub(in json) fn parse_whitespace(
    &mut self
)
[src]

pub(in json) fn parse_number(
    &mut self
) -> JsonEvent
[src]

pub(in json) fn parse_u64(
    &mut self
) -> Result<u64, ParserError>
[src]

pub(in json) fn parse_decimal(
    &mut self,
    res: f64
) -> Result<f64, ParserError>
[src]

pub(in json) fn parse_exponent(
    &mut self,
    res: f64
) -> Result<f64, ParserError>
[src]

pub(in json) fn decode_hex_escape(
    &mut self
) -> Result<u16, ParserError>
[src]

pub(in json) fn parse_str(
    &mut self
) -> Result<String, ParserError>
[src]

pub(in json) fn parse(
    &mut self
) -> JsonEvent
[src]

pub(in json) fn parse_start(
    &mut self
) -> JsonEvent
[src]

pub(in json) fn parse_array(
    &mut self,
    first: bool
) -> JsonEvent
[src]

pub(in json) fn parse_array_comma_or_end(
    &mut self
) -> Option<JsonEvent>
[src]

pub(in json) fn parse_object(
    &mut self,
    first: bool
) -> JsonEvent
[src]

pub(in json) fn parse_object_end(
    &mut self
) -> JsonEvent
[src]

pub(in json) fn parse_value(
    &mut self
) -> JsonEvent
[src]

pub(in json) fn parse_ident(
    &mut self,
    ident: &str,
    value: JsonEvent
) -> JsonEvent
[src]

pub(in json) fn error_event(
    &mut self,
    reason: ErrorCode
) -> JsonEvent
[src]

Trait Implementations

impl<T: Iterator<Item = char>> Iterator for Parser<T>[src]

type Item = JsonEvent

The type of the elements being iterated over.

Auto Trait Implementations

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

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

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

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

impl<T> UnwindSafe for Parser<T> where
    T: UnwindSafe, 

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized, 
[src]

impl<T> Borrow<T> for T where
    T: ?Sized, 
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator, 
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.