Skip to main content

QuantifierNToM

Struct QuantifierNToM 

Source
pub struct QuantifierNToM<I: HaystackItem, A: Matcher<I>, const N: usize, const M: usize>(pub PhantomData<I>, pub PhantomData<A>);

Tuple Fields§

§0: PhantomData<I>§1: PhantomData<A>

Trait Implementations§

Source§

impl<I: Clone + HaystackItem, A: Clone + Matcher<I>, const N: usize, const M: usize> Clone for QuantifierNToM<I, A, N, M>

Source§

fn clone(&self) -> QuantifierNToM<I, A, N, M>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<I: HaystackItem, A: Matcher<I>, const N: usize, const M: usize> Debug for QuantifierNToM<I, A, N, M>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<I: Default + HaystackItem, A: Default + Matcher<I>, const N: usize, const M: usize> Default for QuantifierNToM<I, A, N, M>

Source§

fn default() -> QuantifierNToM<I, A, N, M>

Returns the “default value” for a type. Read more
Source§

impl<I: HaystackItem, A: Matcher<I>, const N: usize, const M: usize> LazyMatcher<I> for QuantifierNToM<I, A, N, M>

Source§

type LazyAllMatches<'a, H: HaystackOf<'a, I>> = Chain<IntoIter<usize>, LazyAllMatchesNToM<'a, I, H, A, N, M>>

Source§

type LazyAllCaptures<'a, H: HaystackOf<'a, I>> = Chain<IntoIter<(usize, IndexedCaptures)>, LazyAllCapturesNToM<'a, I, H, A, N, M>>

Source§

fn lazy_matches<'a, H: HaystackOf<'a, I>>(hay: &mut H) -> bool

Functions exactly the same as Matcher::matches, except that the haystack’s index is left at the first location where the match is considered successful.
Source§

fn lazy_all_matches<'a, H: HaystackOf<'a, I>>( hay: &mut H, ) -> Self::LazyAllMatches<'a, H>

Functions exactly the same as Matcher::all_matches, except that the indices are produced in the opposite order. The first value returned by the iterator is the one first encountered in the haystack, not the one that produces the longest match.
Source§

fn lazy_captures<'a, H: HaystackOf<'a, I>>( hay: &mut H, caps: &mut IndexedCaptures, ) -> bool

Functions exactly the same as Matcher::captures, except that the haystack’s index and captures represent the first location where the match is considered successful.
Source§

fn lazy_all_captures<'a, H: HaystackOf<'a, I>>( hay: &mut H, caps: &mut IndexedCaptures, ) -> Self::LazyAllCaptures<'a, H>

Functions exactly the same as Matcher::all_captures, except that the indices and captures are produced in the opposite order. The first value returned by the iterator is the one first encountered in the haystack, not the one that produces the longest match.
Source§

impl<I: HaystackItem, A: Matcher<I>, const N: usize, const M: usize> Matcher<I> for QuantifierNToM<I, A, N, M>

Source§

type AllMatches<'a, H: HaystackOf<'a, I>> = Rev<IntoIter<usize>>

Source§

type AllCaptures<'a, H: HaystackOf<'a, I>> = Rev<IntoIter<(usize, IndexedCaptures)>>

Source§

fn matches<'a, H: HaystackOf<'a, I>>(hay: &mut H) -> bool

Checks if the start of the haystack contains a match for this Matcher. If this method successfully matches the start of the haystack, hay is progressed so that hay.item() hasn’t been matched yet. On a fail, the state of hay is undefined.
Source§

fn all_matches<'a, H: HaystackOf<'a, I>>(hay: &mut H) -> Self::AllMatches<'a, H>

Produces a Vec of all valid haystack states produced as the result of a valid match at the start of hay, used to implement backtracking. The Vec is produced in reverse priority order, so the last match has the highest priority. After calling all_matches, the state of hay itself is undefined. Read more
Source§

fn captures<'a, H: HaystackOf<'a, I>>( hay: &mut H, caps: &mut IndexedCaptures, ) -> bool

Checks if the start of the haystack contains a match for this Matcher, writing any groups to caps. Similar to matches, this method progresses hay and caps on a success. On a fail, they have undefined states. Read more
Source§

fn all_captures<'a, H: HaystackOf<'a, I>>( hay: &mut H, caps: &mut IndexedCaptures, ) -> Self::AllCaptures<'a, H>

Produces a Vec of all valid captures (and accompanying haystack states) present at the start of hay. Used to implement backtracking for capturing methods. As with all_matches, the resulting Vec is produced in reverse priority order. After calling all_captures, the state of hay and caps are undefined. Read more
Source§

impl<I: Copy + HaystackItem, A: Copy + Matcher<I>, const N: usize, const M: usize> Copy for QuantifierNToM<I, A, N, M>

Auto Trait Implementations§

§

impl<I, A, const N: usize, const M: usize> Freeze for QuantifierNToM<I, A, N, M>

§

impl<I, A, const N: usize, const M: usize> RefUnwindSafe for QuantifierNToM<I, A, N, M>

§

impl<I, A, const N: usize, const M: usize> Send for QuantifierNToM<I, A, N, M>
where I: Send, A: Send,

§

impl<I, A, const N: usize, const M: usize> Sync for QuantifierNToM<I, A, N, M>
where I: Sync, A: Sync,

§

impl<I, A, const N: usize, const M: usize> Unpin for QuantifierNToM<I, A, N, M>
where I: Unpin, A: Unpin,

§

impl<I, A, const N: usize, const M: usize> UnsafeUnpin for QuantifierNToM<I, A, N, M>

§

impl<I, A, const N: usize, const M: usize> UnwindSafe for QuantifierNToM<I, A, N, M>
where I: UnwindSafe, A: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.