pub struct NonEmpty<P>(pub P);Expand description
Discards empty strings from a match.
Some atoms that needs to match an undefined number of other atoms (like
Repeat or LazyRepeat)
may enter in an infinite loop if the inner atom matches an empty string "".
In that case there is always a match but the atom does not progress, resulting so in an
endless cycle.
This tool takes another tool and converts any match with an empty string with a missing match, avoiding this issue.
Tuple Fields§
§0: PTrait Implementations§
impl<P: Copy> Copy for NonEmpty<P>
Auto Trait Implementations§
impl<P> Freeze for NonEmpty<P>where
P: Freeze,
impl<P> RefUnwindSafe for NonEmpty<P>where
P: RefUnwindSafe,
impl<P> Send for NonEmpty<P>where
P: Send,
impl<P> Sync for NonEmpty<P>where
P: Sync,
impl<P> Unpin for NonEmpty<P>where
P: Unpin,
impl<P> UnsafeUnpin for NonEmpty<P>where
P: UnsafeUnpin,
impl<P> UnwindSafe for NonEmpty<P>where
P: 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