pub enum AggregateRule {
ExhaustiveExactlyOnce,
NoRepeat,
DeclaredMultiplicity(DeclaredCounts),
DeclaredOmissions(DeclaredCounts),
ProjectedAggregate(ProjectedRule),
FreeOrder,
}Expand description
Aggregate rule data compiled from symbols into private canonical positions. Callers never provide raw ordinals.
Variants§
ExhaustiveExactlyOnce
Every alphabet symbol occurs exactly once.
NoRepeat
Symbols may be omitted but no symbol may repeat.
DeclaredMultiplicity(DeclaredCounts)
Explicit per-symbol multiplicity data.
DeclaredOmissions(DeclaredCounts)
Explicit set of omitted symbols; every other symbol occurs once.
ProjectedAggregate(ProjectedRule)
Explicit projection classes and their required multiplicities.
FreeOrder
Any finite order of alphabet members, including repeats.
Implementations§
Source§impl AggregateRule
impl AggregateRule
Sourcepub const fn exhaustive_exactly_once() -> AggregateRule
pub const fn exhaustive_exactly_once() -> AggregateRule
Constructs an exhaustive exactly-once rule.
Sourcepub const fn no_repeat() -> AggregateRule
pub const fn no_repeat() -> AggregateRule
Constructs a no-repeat rule.
Sourcepub const fn free_order() -> AggregateRule
pub const fn free_order() -> AggregateRule
Constructs a free-order rule.
Sourcepub fn declared_multiplicity<A, I>(
alphabet: &A,
declarations: I,
) -> Result<AggregateRule, AggregateRuleError>
pub fn declared_multiplicity<A, I>( alphabet: &A, declarations: I, ) -> Result<AggregateRule, AggregateRuleError>
Compiles an explicit positive multiplicity for every alphabet symbol.
Sourcepub fn declared_omissions<A, I>(
alphabet: &A,
omissions: I,
) -> Result<AggregateRule, AggregateRuleError>
pub fn declared_omissions<A, I>( alphabet: &A, omissions: I, ) -> Result<AggregateRule, AggregateRuleError>
Compiles a set of symbols to omit; every remaining symbol is required once.
Sourcepub fn projected_aggregate<A, I>(
alphabet: &A,
classes: I,
) -> Result<AggregateRule, AggregateRuleError>
pub fn projected_aggregate<A, I>( alphabet: &A, classes: I, ) -> Result<AggregateRule, AggregateRuleError>
Compiles a complete, disjoint projection of alphabet symbols into classes.
Sourcepub const fn kind(&self) -> AggregateRuleKind
pub const fn kind(&self) -> AggregateRuleKind
Returns the public category of this rule.
Sourcepub fn declared_counts<A>(
&self,
alphabet: &A,
) -> Result<Option<Vec<(<A as SerialAlphabet>::Symbol, usize)>>, AggregateRuleError>where
A: SerialAlphabet,
pub fn declared_counts<A>(
&self,
alphabet: &A,
) -> Result<Option<Vec<(<A as SerialAlphabet>::Symbol, usize)>>, AggregateRuleError>where
A: SerialAlphabet,
Returns symbol/count declarations for a declared multiplicity or omission rule.
Sourcepub fn projected_classes<A>(
&self,
alphabet: &A,
) -> Result<Option<Vec<ProjectedClassSpec<<A as SerialAlphabet>::Symbol>>>, AggregateRuleError>where
A: SerialAlphabet,
pub fn projected_classes<A>(
&self,
alphabet: &A,
) -> Result<Option<Vec<ProjectedClassSpec<<A as SerialAlphabet>::Symbol>>>, AggregateRuleError>where
A: SerialAlphabet,
Returns symbolic projected-class declarations for a projected rule.
Trait Implementations§
Source§impl Clone for AggregateRule
impl Clone for AggregateRule
Source§fn clone(&self) -> AggregateRule
fn clone(&self) -> AggregateRule
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AggregateRule
impl Debug for AggregateRule
impl Eq for AggregateRule
Source§impl PartialEq for AggregateRule
impl PartialEq for AggregateRule
impl StructuralPartialEq for AggregateRule
Auto Trait Implementations§
impl Freeze for AggregateRule
impl RefUnwindSafe for AggregateRule
impl Send for AggregateRule
impl Sync for AggregateRule
impl Unpin for AggregateRule
impl UnsafeUnpin for AggregateRule
impl UnwindSafe for AggregateRule
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
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§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<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