Skip to main content

RepetitionQuantifier

Enum RepetitionQuantifier 

Source
pub enum RepetitionQuantifier {
Show 21 variants ZeroOrMore, OneOrMore, AtMostOne, Exactly(u32), AtLeast(u32), AtMost(u32), Range(u32, u32), ZeroOrMoreReluctant, OneOrMoreReluctant, AtMostOneReluctant, ExactlyReluctant(u32), AtLeastReluctant(u32), AtMostReluctant(u32), RangeReluctant(u32, u32), ZeroOrMorePossessive, OneOrMorePossessive, AtMostOnePossessive, ExactlyPossessive(u32), AtLeastPossessive(u32), AtMostPossessive(u32), RangePossessive(u32, u32),
}
Expand description

Quantifier for pattern repetition.

Source planning and public logical-node construction accept greedy and reluctant forms. Possessive variants are internal optimizer markers whose row-local exit suppression requires a proof that it preserves match results. They do not define general atomic repetition for arbitrary pattern bodies, and programmatic or Substrait source requests cannot supply them.

Variants§

§

ZeroOrMore

Zero or more (*)

§

OneOrMore

One or more (+)

§

AtMostOne

At most one (?)

§

Exactly(u32)

Exactly n occurrences

§

AtLeast(u32)

At least n occurrences

§

AtMost(u32)

At most n occurrences

§

Range(u32, u32)

Between n and m occurrences

§

ZeroOrMoreReluctant

Zero or more, preferring fewer occurrences (*?).

§

OneOrMoreReluctant

One or more, preferring fewer occurrences (+?).

§

AtMostOneReluctant

At most one, preferring zero occurrences (??).

§

ExactlyReluctant(u32)

Exactly n occurrences ({n}?). There is no repetition choice.

§

AtLeastReluctant(u32)

At least n occurrences, preferring fewer occurrences ({n,}?).

§

AtMostReluctant(u32)

At most n occurrences, preferring fewer occurrences ({,n}?).

§

RangeReluctant(u32, u32)

Between n and m occurrences, preferring fewer occurrences ({n,m}?).

§

ZeroOrMorePossessive

Internal possessive marker for zero or more (*+).

§

OneOrMorePossessive

Internal possessive marker for one or more (++).

§

AtMostOnePossessive

Internal possessive marker for at most one (?+).

§

ExactlyPossessive(u32)

Internal possessive marker for exactly n occurrences ({n}+).

Semantically equivalent to Exactly(n) because a fixed-count repetition offers no backtracking choice (it either matches n times or fails). Included to preserve the optimizer’s intent and for consistency in AST transformations.

§

AtLeastPossessive(u32)

Internal possessive marker for at least n occurrences ({n,}+).

§

AtMostPossessive(u32)

Internal possessive marker for at most n occurrences ({,m}+).

§

RangePossessive(u32, u32)

Internal possessive marker for between n and m occurrences ({n,m}+).

Implementations§

Source§

impl RepetitionQuantifier

Source

pub const fn is_possessive(&self) -> bool

Returns true when the quantifier is possessive.

Source

pub const fn is_reluctant(&self) -> bool

Returns true when the quantifier prefers fewer repetitions.

Source

pub const fn fixed_count(&self) -> Option<u32>

Returns the exact repetition count when the quantifier is fixed.

Source

pub const fn min_repetitions(&self) -> u32

Returns the minimum number of repetitions required.

Source

pub const fn max_repetitions(&self) -> Option<u32>

Returns the maximum number of repetitions allowed, if bounded.

Source

pub fn normalized(&self) -> Self

Return an equivalent standard spelling, such as ? for {0,1}, while preserving repetition preference.

Source

pub fn reluctant_variant(&self) -> Option<Self>

Returns the reluctant counterpart when this quantifier is greedy.

Source

pub fn possessive_variant(&self) -> Option<Self>

Return the internal possessive marker when this quantifier is greedy. The optimizer must establish that its exit suppression preserves results.

Trait Implementations§

Source§

impl Clone for RepetitionQuantifier

Source§

fn clone(&self) -> Self

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 Debug for RepetitionQuantifier

Source§

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

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

impl Display for RepetitionQuantifier

Source§

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

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

impl Eq for RepetitionQuantifier

Source§

impl Hash for RepetitionQuantifier

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for RepetitionQuantifier

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PartialOrd for RepetitionQuantifier

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl StructuralPartialEq for RepetitionQuantifier

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> DynEq for T
where T: Eq + Any,

Source§

fn dyn_eq(&self, other: &(dyn Any + 'static)) -> bool

Source§

impl<T> DynHash for T
where T: Hash + Any,

Source§

fn dyn_hash(&self, state: &mut dyn Hasher)

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V