Enum peg_runtime::RuleResult
source · pub enum RuleResult<T> {
Matched(usize, T),
Failed,
}
Expand description
The result type used internally in the parser.
You’ll only need this if implementing the Parse*
traits for a custom input
type. The public API of a parser adapts errors to std::result::Result
.
Variants§
Matched(usize, T)
Success, with final location
Failed
Failure (furthest failure location is not yet known)
Trait Implementations§
source§impl<T: Clone> Clone for RuleResult<T>
impl<T: Clone> Clone for RuleResult<T>
source§fn clone(&self) -> RuleResult<T>
fn clone(&self) -> RuleResult<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<T: Debug> Debug for RuleResult<T>
impl<T: Debug> Debug for RuleResult<T>
source§impl<T: Hash> Hash for RuleResult<T>
impl<T: Hash> Hash for RuleResult<T>
source§impl<T: Ord> Ord for RuleResult<T>
impl<T: Ord> Ord for RuleResult<T>
source§fn cmp(&self, other: &RuleResult<T>) -> Ordering
fn cmp(&self, other: &RuleResult<T>) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<T: PartialEq> PartialEq for RuleResult<T>
impl<T: PartialEq> PartialEq for RuleResult<T>
source§fn eq(&self, other: &RuleResult<T>) -> bool
fn eq(&self, other: &RuleResult<T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<T: PartialOrd> PartialOrd for RuleResult<T>
impl<T: PartialOrd> PartialOrd for RuleResult<T>
source§fn partial_cmp(&self, other: &RuleResult<T>) -> Option<Ordering>
fn partial_cmp(&self, other: &RuleResult<T>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<T: Eq> Eq for RuleResult<T>
impl<T> StructuralPartialEq for RuleResult<T>
Auto Trait Implementations§
impl<T> Freeze for RuleResult<T>where
T: Freeze,
impl<T> RefUnwindSafe for RuleResult<T>where
T: RefUnwindSafe,
impl<T> Send for RuleResult<T>where
T: Send,
impl<T> Sync for RuleResult<T>where
T: Sync,
impl<T> Unpin for RuleResult<T>where
T: Unpin,
impl<T> UnwindSafe for RuleResult<T>where
T: 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