pub enum ParseResult<'a, T, E> {
Done(&'a str, T),
Error(E),
}
Expand description
Represents what to do next in partially completed parsing.
ParseResult
is returned from all intermediate parsers. If you just want to
get back parsed s-expressions, you won’t need to worry about this type since
the top level parsers just return a Result
.
If the parser failed to produce a result, it will return Error
, and if it
succeeded we’ll get the Done
variant containing the value produced and the
rest of the text to work on.
Variants§
Done(&'a str, T)
The parser succeeded, this contains first the un-consumed portion of the input then the result produced by parsing.
Error(E)
The parser failed, the E
represents the reason for the failure.
Trait Implementations§
Source§impl<'a, T: Clone, E: Clone> Clone for ParseResult<'a, T, E>
impl<'a, T: Clone, E: Clone> Clone for ParseResult<'a, T, E>
Source§fn clone(&self) -> ParseResult<'a, T, E>
fn clone(&self) -> ParseResult<'a, T, E>
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreimpl<'a, T: Eq, E: Eq> Eq for ParseResult<'a, T, E>
impl<'a, T, E> StructuralPartialEq for ParseResult<'a, T, E>
Auto Trait Implementations§
impl<'a, T, E> Freeze for ParseResult<'a, T, E>
impl<'a, T, E> RefUnwindSafe for ParseResult<'a, T, E>where
T: RefUnwindSafe,
E: RefUnwindSafe,
impl<'a, T, E> Send for ParseResult<'a, T, E>
impl<'a, T, E> Sync for ParseResult<'a, T, E>
impl<'a, T, E> Unpin for ParseResult<'a, T, E>
impl<'a, T, E> UnwindSafe for ParseResult<'a, T, E>where
T: UnwindSafe,
E: UnwindSafe,
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