pub struct Parser { /* private fields */ }Expand description
A parser that keeps its arena between calls (the “reused” state of the parser gate): a pass over many messages grows it once.
Implementations§
Source§impl Parser
impl Parser
Sourcepub fn with_capacity(nodes: usize) -> Self
pub fn with_capacity(nodes: usize) -> Self
A parser whose arena has room for nodes entries.
Sourcepub fn parse_cst<'p, 'src>(&'p mut self, source: &'src str) -> CstRef<'p, 'src>
pub fn parse_cst<'p, 'src>(&'p mut self, source: &'src str) -> CstRef<'p, 'src>
Parses source into a lossless CST held in this parser’s arena.
Sourcepub fn parse_model<'src>(&mut self, source: &'src str) -> Parsed<'src>
pub fn parse_model<'src>(&mut self, source: &'src str) -> Parsed<'src>
See parse_model; reuses this parser’s arena.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Parser
impl RefUnwindSafe for Parser
impl Send for Parser
impl Sync for Parser
impl Unpin for Parser
impl UnsafeUnpin 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