pub struct Fail<E: Error + Clone + 'static>(pub E);
Expand description
Tuple Fields§
§0: E
Implementations§
Trait Implementations§
source§impl<'input, T: ?Sized + 'input, E: Error + Clone + 'static> Rule<'input, T> for Fail<E>
impl<'input, T: ?Sized + 'input, E: Error + Clone + 'static> Rule<'input, T> for Fail<E>
source§type Output = <fn() -> ! as FnOnce<()>>::Output
type Output = <fn() -> ! as FnOnce<()>>::Output
The type of the value of a successful parse of this rule.
source§fn parse_at<'cursor, 'this, 'index>(
&'this self,
_input: &'cursor mut &'input T,
index: &'index mut usize,
) -> Result<Self::Output, ParseError>where
'input: 'this,
fn parse_at<'cursor, 'this, 'index>(
&'this self,
_input: &'cursor mut &'input T,
index: &'index mut usize,
) -> Result<Self::Output, ParseError>where
'input: 'this,
Parses a rule at a given index with a given input. Read more
source§fn parse<'this>(
&'this self,
input: &'input SliceType,
) -> Result<(&'input SliceType, Self::Output), ParseError>where
'input: 'this,
fn parse<'this>(
&'this self,
input: &'input SliceType,
) -> Result<(&'input SliceType, Self::Output), ParseError>where
'input: 'this,
Parses a given rule at the start of some input. Read more
source§fn map_parsed<Output, F: Fn(Self::Output) -> Output>(
self,
function: F,
) -> Map<'input, SliceType, Self, Output, F>where
Self: Sized,
fn map_parsed<Output, F: Fn(Self::Output) -> Output>(
self,
function: F,
) -> Map<'input, SliceType, Self, Output, F>where
Self: Sized,
Maps an infallible function onto the output of a rule.
source§fn try_map_parsed<Output, E: Error + 'static, F: Fn(Self::Output) -> Result<Output, E>>(
self,
function: F,
) -> TryMap<'input, SliceType, Self, Output, E, F>where
Self: Sized,
fn try_map_parsed<Output, E: Error + 'static, F: Fn(Self::Output) -> Result<Output, E>>(
self,
function: F,
) -> TryMap<'input, SliceType, Self, Output, E, F>where
Self: Sized,
Maps a function onto the output of a rule, passing the error back if it fails.
source§fn repeat_for<const REPS: usize>(
self,
) -> RepeatFor<'input, SliceType, Self, REPS>where
Self: Sized,
fn repeat_for<const REPS: usize>(
self,
) -> RepeatFor<'input, SliceType, Self, REPS>where
Self: Sized,
Repeats this rule a known amount of times.
source§fn repeat(self, reps: usize) -> Repeat<'input, SliceType, Self>where
Self: Sized,
fn repeat(self, reps: usize) -> Repeat<'input, SliceType, Self>where
Self: Sized,
Repeats this rule a set amount of times.
source§fn take(self, at_most: usize) -> Many<'input, SliceType, Self>where
Self: Sized,
fn take(self, at_most: usize) -> Many<'input, SliceType, Self>where
Self: Sized,
Repeats this rule at most a set amount of times.
impl<E: Error + Clone + 'static> StructuralPartialEq for Fail<E>
Auto Trait Implementations§
impl<E> Freeze for Fail<E>where
E: Freeze,
impl<E> RefUnwindSafe for Fail<E>where
E: RefUnwindSafe,
impl<E> Send for Fail<E>where
E: Send,
impl<E> Sync for Fail<E>where
E: Sync,
impl<E> Unpin for Fail<E>where
E: Unpin,
impl<E> UnwindSafe for Fail<E>where
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