pub struct Parser { /* private fields */ }
Expand description
Parser type
This is a high level object that wraps the file loader/parser.his doesn’t do much special. The ParseSess object must be borrowed by the parsing processing. So this class ensures this is happening without much drama or requiring you to peer into the syntex_syntax internals.
There are methods to load external files, and borrow a string. That’ll be immediately cloned just fyi.
Implementations§
Source§impl Parser
impl Parser
Sourcepub fn get_tokens<'a>(&'a self, path: &str) -> Result<Vec<Token>, Fault<'a>>
pub fn get_tokens<'a>(&'a self, path: &str) -> Result<Vec<Token>, Fault<'a>>
Get a vector of all tokens, or get an error. Loads a file
Sourcepub fn get_tokentree<'a>(
&'a self,
path: &str,
) -> Result<Vec<TokenTree>, Fault<'a>>
pub fn get_tokentree<'a>( &'a self, path: &str, ) -> Result<Vec<TokenTree>, Fault<'a>>
Get the token tree, or get an error. Loads a file
Auto Trait Implementations§
impl !Freeze for Parser
impl !RefUnwindSafe for Parser
impl !Send for Parser
impl !Sync for Parser
impl Unpin for Parser
impl !UnwindSafe for Parser
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more