pub struct Parser<'a> { /* private fields */ }Implementations§
Source§impl<'a> Parser<'a>
impl<'a> Parser<'a>
Sourcepub fn new(buf: &'a [u8], canonical: bool) -> Self
pub fn new(buf: &'a [u8], canonical: bool) -> Self
A parser over buf. With canonical it also records every
canonical violation (see Parser::warnings).
Sourcepub fn dead_elements(&self) -> usize
pub fn dead_elements(&self) -> usize
Dead elements met in bodies (the heading’s dead keys are not counted).
Sourcepub fn heading(
&mut self,
pos: usize,
stop: usize,
) -> Result<(Heading<'a>, usize)>
pub fn heading( &mut self, pos: usize, stop: usize, ) -> Result<(Heading<'a>, usize)>
After SYN. Returns the heading (dead keys dropped, duplicates kept) and the position of the first body code.
Sourcepub fn body(
&mut self,
pos: usize,
stop: usize,
level: bool,
) -> Result<(Vec<FileView<'a>>, usize)>
pub fn body( &mut self, pos: usize, stop: usize, level: bool, ) -> Result<(Vec<FileView<'a>>, usize)>
A body from pos to stop. At depth zero (level false) commits are
legal and the body ends at EOT, SYN, EM or stop; in a level it ends
at CAN. Returns the files (dead elements dropped) and the position
of the code that ended the body.
Sourcepub fn record(&mut self, pos: usize, stop: usize) -> Result<(Record<'a>, usize)>
pub fn record(&mut self, pos: usize, stop: usize) -> Result<(Record<'a>, usize)>
After RS. Returns the record and the position after it.
Auto Trait Implementations§
impl<'a> Forget for Parser<'a>
impl<'a> Freeze for Parser<'a>
impl<'a> Move for Parser<'a>
impl<'a> RefUnwindSafe for Parser<'a>
impl<'a> Send for Parser<'a>
impl<'a> Sync for Parser<'a>
impl<'a> Unpin for Parser<'a>
impl<'a> UnsafeUnpin for Parser<'a>
impl<'a> UnwindSafe for Parser<'a>
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