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

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.

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

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

fn bump(&mut self)[src]

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

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

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

fn parse_whitespace(&mut self)[src]

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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.