pub struct SkipUntil<I, F, const N: usize>(_, _, _, _);
Expand description
See skip_until
.
Implementations
sourceimpl<I, F, const N: usize> SkipUntil<I, F, N>
impl<I, F, const N: usize> SkipUntil<I, F, 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 + PartialEq, O, F: Fn(E::Span) -> O, E: Error<I>, const N: usize> Strategy<I, O, E> for SkipUntil<I, F, N>
impl<I: Clone + PartialEq, O, F: Fn(E::Span) -> O, E: Error<I>, const N: usize> Strategy<I, O, E> for SkipUntil<I, F, 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, F: Copy, const N: usize> Copy for SkipUntil<I, F, N>
Auto Trait Implementations
impl<I, F, const N: usize> RefUnwindSafe for SkipUntil<I, F, N> where
F: RefUnwindSafe,
I: RefUnwindSafe,
impl<I, F, const N: usize> Send for SkipUntil<I, F, N> where
F: Send,
I: Send,
impl<I, F, const N: usize> Sync for SkipUntil<I, F, N> where
F: Sync,
I: Sync,
impl<I, F, const N: usize> Unpin for SkipUntil<I, F, N> where
F: Unpin,
I: Unpin,
impl<I, F, const N: usize> UnwindSafe for SkipUntil<I, F, N> where
F: UnwindSafe,
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