[−][src]Struct autumn::ParseResult
The result of executing a parser
When executing a parser over a given input source the parser may correctly parse one or more interpreteations of the source and produce a result value or a group of errors for each interpretation.
Methods
impl<'s, T, E> ParseResult<'s, T, E>
[src]
pub fn values<'r>(&'r self) -> impl Iterator<Item = &'r T> + 'r
[src]
Produce an iterator over references to all values produced from successful parses.
Only parses that produced a value and had no associated errors or exceptions are produced.
pub fn take_values(&mut self) -> impl Iterator<Item = T>
[src]
Produce an iterator over all values produced from successful parses.
Only parses that produced a value and had no associated errors or exceptions are produced. Values that are produced are removed from the result. Parses with associated errors or exceptions remain in the result.
pub fn errors<'r>(
&'r self
) -> impl Iterator<Item = Meta<impl AsRef<E>, Span>> + 'r
[src]
&'r self
) -> impl Iterator<Item = Meta<impl AsRef<E>, Span>> + 'r
Produce an iterator over references to all errors from all complete parses
pub fn exceptions<'r>(
&'r self
) -> impl Iterator<Item = Meta<impl AsRef<E>, Span>> + 'r
[src]
&'r self
) -> impl Iterator<Item = Meta<impl AsRef<E>, Span>> + 'r
Produce an iterator over references to all uncaught exceptions from all complete parses
pub fn is_success(&self) -> bool
[src]
Check if a parse was successful.
A parse is considered successful if there was at least one execution of the parse over the input that produced a result and there were no complete executions of the parser that produced any errors.
pub fn is_none(&self) -> bool
[src]
Check if there were no complete parses of the input.
pub fn single_parse(&self) -> bool
[src]
Check if there was only a single successful parse of the input
impl<'s, T, E: Clone> ParseResult<'s, T, E>
[src]
pub fn cloned_errors<'r>(&'r self) -> impl Iterator<Item = Meta<E, Span>> + 'r
[src]
Produce an iterator over to all errors from all complete parses
Clones each error.
pub fn cloned_exceptions<'r>(
&'r self
) -> impl Iterator<Item = Meta<E, Span>> + 'r
[src]
&'r self
) -> impl Iterator<Item = Meta<E, Span>> + 'r
Produce an iterator over to all uncaught exceptions from all complete parses
Clones each exception.
Trait Implementations
impl<'s, T: Debug, E: Debug> Debug for ParseResult<'s, T, E>
[src]
Auto Trait Implementations
impl<'s, T, E = ()> !RefUnwindSafe for ParseResult<'s, T, E>
impl<'s, T, E = ()> !Send for ParseResult<'s, T, E>
impl<'s, T, E = ()> !Sync for ParseResult<'s, T, E>
impl<'s, T, E> Unpin for ParseResult<'s, T, E> where
T: Unpin,
T: Unpin,
impl<'s, T, E = ()> !UnwindSafe for ParseResult<'s, T, E>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,