[][src]Struct wast::lexer::Lexer

pub struct Lexer<'a> { /* fields omitted */ }

A structure used to lex the s-expression syntax of WAT files.

This structure is used to generate Source items, which should account for every single byte of the input as we iterate over it. A LexError is returned for any non-lexable text.

Methods

impl<'a> Lexer<'a>[src]

Important traits for Lexer<'a>
pub fn new(input: &str) -> Lexer[src]

Creates a new lexer which will lex the input source string.

pub fn input(&self) -> &'a str[src]

Returns the original source input that we're lexing.

pub fn parse(&mut self) -> Result<Option<Source<'a>>, Error>[src]

Lexes the next token in the input.

Returns Some if a token is found or None if we're at EOF.

Errors

Returns an error if the input is malformed.

Trait Implementations

impl<'a> Clone for Lexer<'a>[src]

impl<'a> Iterator for Lexer<'a>[src]

type Item = Result<Source<'a>, Error>

The type of the elements being iterated over.

Auto Trait Implementations

impl<'a> RefUnwindSafe for Lexer<'a>

impl<'a> Send for Lexer<'a>

impl<'a> Sync for Lexer<'a>

impl<'a> Unpin for Lexer<'a>

impl<'a> UnwindSafe for Lexer<'a>

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.