Struct chumsky::recovery::SkipThenRetryUntil
source · [−]pub struct SkipThenRetryUntil<I, const N: usize>(_, _, _);
Expand description
Implementations
sourceimpl<I, const N: usize> SkipThenRetryUntil<I, N>
impl<I, const N: usize> SkipThenRetryUntil<I, N>
sourcepub fn skip_start(self) -> Self
pub fn skip_start(self) -> Self
Alters this recovery strategy so that the first token will always be skipped.
This is useful when the input being searched for also appears at the beginning of the pattern that failed to parse.
sourcepub fn consume_end(self) -> Self
pub fn consume_end(self) -> Self
Alters this recovery strategy so that the synchronisation token will be consumed during recovery.
This is useful when the input being searched for is a delimiter of a prior pattern rather than the start of a new pattern and hence is no longer important once recovery has occurred.
Trait Implementations
sourceimpl<I: Clone, const N: usize> Clone for SkipThenRetryUntil<I, N>
impl<I: Clone, const N: usize> Clone for SkipThenRetryUntil<I, N>
sourcefn clone(&self) -> SkipThenRetryUntil<I, N>
fn clone(&self) -> SkipThenRetryUntil<I, N>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<I: Clone + PartialEq, O, E: Error<I>, const N: usize> Strategy<I, O, E> for SkipThenRetryUntil<I, N>
impl<I: Clone + PartialEq, O, E: Error<I>, const N: usize> Strategy<I, O, E> for SkipThenRetryUntil<I, N>
sourcefn recover<D: Debugger, P: Parser<I, O, Error = E>>(
&self,
a_errors: Vec<Located<I, P::Error>>,
a_err: Located<I, P::Error>,
parser: P,
debugger: &mut D,
stream: &mut Stream<'_, I, <P::Error as Error<I>>::Span>
) -> (Vec<Located<I, P::Error>>, Result<(O, Option<Located<I, P::Error>>), Located<I, P::Error>>)
fn recover<D: Debugger, P: Parser<I, O, Error = E>>(
&self,
a_errors: Vec<Located<I, P::Error>>,
a_err: Located<I, P::Error>,
parser: P,
debugger: &mut D,
stream: &mut Stream<'_, I, <P::Error as Error<I>>::Span>
) -> (Vec<Located<I, P::Error>>, Result<(O, Option<Located<I, P::Error>>), Located<I, P::Error>>)
Recover from a parsing failure.
impl<I: Copy, const N: usize> Copy for SkipThenRetryUntil<I, N>
Auto Trait Implementations
impl<I, const N: usize> RefUnwindSafe for SkipThenRetryUntil<I, N> where
I: RefUnwindSafe,
impl<I, const N: usize> Send for SkipThenRetryUntil<I, N> where
I: Send,
impl<I, const N: usize> Sync for SkipThenRetryUntil<I, N> where
I: Sync,
impl<I, const N: usize> Unpin for SkipThenRetryUntil<I, N> where
I: Unpin,
impl<I, const N: usize> UnwindSafe for SkipThenRetryUntil<I, N> where
I: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more