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
impl RepetitionQuantifier
Sourcepub const fn is_possessive(&self) -> bool
pub const fn is_possessive(&self) -> bool
Returns true when the quantifier is possessive.
Sourcepub const fn is_reluctant(&self) -> bool
pub const fn is_reluctant(&self) -> bool
Returns true when the quantifier prefers fewer repetitions.
Sourcepub const fn fixed_count(&self) -> Option<u32>
pub const fn fixed_count(&self) -> Option<u32>
Returns the exact repetition count when the quantifier is fixed.
Sourcepub const fn min_repetitions(&self) -> u32
pub const fn min_repetitions(&self) -> u32
Returns the minimum number of repetitions required.
Sourcepub const fn max_repetitions(&self) -> Option<u32>
pub const fn max_repetitions(&self) -> Option<u32>
Returns the maximum number of repetitions allowed, if bounded.
Sourcepub fn normalized(&self) -> Self
pub fn normalized(&self) -> Self
Return an equivalent standard spelling, such as ? for {0,1}, while
preserving repetition preference.
Sourcepub fn reluctant_variant(&self) -> Option<Self>
pub fn reluctant_variant(&self) -> Option<Self>
Returns the reluctant counterpart when this quantifier is greedy.
Sourcepub fn possessive_variant(&self) -> Option<Self>
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
impl Clone for RepetitionQuantifier
Source§impl Debug for RepetitionQuantifier
impl Debug for RepetitionQuantifier
Source§impl Display for RepetitionQuantifier
impl Display for RepetitionQuantifier
impl Eq for RepetitionQuantifier
Source§impl Hash for RepetitionQuantifier
impl Hash for RepetitionQuantifier
Source§impl PartialEq for RepetitionQuantifier
impl PartialEq for RepetitionQuantifier
Source§impl PartialOrd for RepetitionQuantifier
impl PartialOrd for RepetitionQuantifier
impl StructuralPartialEq for RepetitionQuantifier
Auto Trait Implementations§
impl Forget for RepetitionQuantifier
impl Freeze for RepetitionQuantifier
impl Move for RepetitionQuantifier
impl RefUnwindSafe for RepetitionQuantifier
impl Send for RepetitionQuantifier
impl Sync for RepetitionQuantifier
impl Unpin for RepetitionQuantifier
impl UnsafeUnpin for RepetitionQuantifier
impl UnwindSafe for RepetitionQuantifier
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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