Struct Context Copy item path Source pub struct Context<I: Stream > { }Expand description A high-level wrapper around an input Stream .
It handles errors, and tracks the Location s of the input Tokens
that could form part of the next output Token. It also provides an
unread() method to pretend that you didn’t read a Token.
Returns a Location containing all Token s read() so far, and
forgets them.
Read the next Token and internally record its Location .
Ok(tree) - The parse Tree of the next Token.
Err(msg) - An error prevented parsing of the next Token.
Read the next Token and internally record its Location , but
only if its parse Tree is of type T.
Ok(Some(tree)) - The next Token’s parse tree is of type T.
Ok(None) - The next Token is not a T. It has been unread().
Err(message) - An error prevented parsing of the next Token.
Read the next Token and internally record its Location , but
only if it is_wanted.
Ok(Some(tree)) - If is_wanted(tree).
Ok(None) - The next Token’s parse tree is not a T or is unwanted.
It has been unread().
Err(message) - An error prevented parsing of the next Token.
Pretend we haven’t read the most recent Token .
tree must be the parse Tree of the most recent Token. It will
be returned by the next call to read().
Immutably borrows from an owned value.
Read more Mutably borrows from an owned value.
Read more Returns the argument unchanged.
Calls U::from(self).
That is, this conversion is whatever the implementation of
From <T> for U chooses to do.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.