[][src]Enum wast::lexer::Source

pub enum Source<'a> {
    Comment(Comment<'a>),
    Whitespace(&'a str),
    Token(Token<'a>),
}

A fragment of source lex'd from an input string.

This enumeration contains all kinds of fragments, including comments and whitespace. For most cases you'll probably ignore these and simply look at tokens.

Variants

Comment(Comment<'a>)

A fragment of source that is a comment, either a line or a block comment.

Whitespace(&'a str)

A fragment of source that represents whitespace.

Token(Token<'a>)

A fragment of source that represents an actual s-expression token.

Methods

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

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

Returns the original source text for this token.

Trait Implementations

impl<'a> Debug for Source<'a>[src]

impl<'a> PartialEq<Source<'a>> for Source<'a>[src]

impl<'a> StructuralPartialEq for Source<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Source<'a>

impl<'a> Send for Source<'a>

impl<'a> Sync for Source<'a>

impl<'a> Unpin for Source<'a>

impl<'a> UnwindSafe for Source<'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<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.