Struct parser_compose::FailureLog
source · pub struct FailureLog { /* private fields */ }
Expand description
A log of parser failures sorted by input position in descending order.
This is returned when when parsers fail.
Implementations§
source§impl FailureLog
impl FailureLog
sourcepub fn add(&mut self, reason: Reason, position: usize)
pub fn add(&mut self, reason: Reason, position: usize)
Record a new parser failure at a given input position
sourcepub fn pop(&mut self) -> Option<ParserFailure>
pub fn pop(&mut self) -> Option<ParserFailure>
Pops ParserFailure
s from the log in descending order of input position
Returns None
if the log is empty
sourcepub fn peek(&self) -> Option<&ParserFailure>
pub fn peek(&self) -> Option<&ParserFailure>
Peeks the next ParserFailure
from the log in descending order of input position
Returns None
if the log is empty
sourcepub fn to_vec(self) -> Vec<ParserFailure>
pub fn to_vec(self) -> Vec<ParserFailure>
Consumes the log and returns a vector of ParserFailure
s sorted in ascending order of
input position
Trait Implementations§
source§impl Debug for FailureLog
impl Debug for FailureLog
Auto Trait Implementations§
impl RefUnwindSafe for FailureLog
impl Send for FailureLog
impl Sync for FailureLog
impl Unpin for FailureLog
impl UnwindSafe for FailureLog
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