Skip to main content

AggregateRule

Enum AggregateRule 

Source
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

Source

pub const fn exhaustive_exactly_once() -> Self

Constructs an exhaustive exactly-once rule.

Source

pub const fn no_repeat() -> Self

Constructs a no-repeat rule.

Source

pub const fn free_order() -> Self

Constructs a free-order rule.

Source

pub fn declared_multiplicity<A, I>( alphabet: &A, declarations: I, ) -> Result<Self, AggregateRuleError>
where A: SerialAlphabet, I: IntoIterator<Item = (A::Symbol, usize)>,

Compiles an explicit positive multiplicity for every alphabet symbol.

Source

pub fn declared_omissions<A, I>( alphabet: &A, omissions: I, ) -> Result<Self, AggregateRuleError>
where A: SerialAlphabet, I: IntoIterator<Item = A::Symbol>,

Compiles a set of symbols to omit; every remaining symbol is required once.

Source

pub fn projected_aggregate<A, I>( alphabet: &A, classes: I, ) -> Result<Self, AggregateRuleError>

Compiles a complete, disjoint projection of alphabet symbols into classes.

Source

pub const fn kind(&self) -> AggregateRuleKind

Returns the public category of this rule.

Source

pub fn declared_counts<A>( &self, alphabet: &A, ) -> Result<Option<Vec<SymbolCount<A::Symbol>>>, AggregateRuleError>
where A: SerialAlphabet,

Returns symbol/count declarations for a declared multiplicity or omission rule.

Source

pub fn projected_classes<A>( &self, alphabet: &A, ) -> Result<Option<Vec<ProjectedClassSpec<A::Symbol>>>, AggregateRuleError>
where A: SerialAlphabet,

Returns symbolic projected-class declarations for a projected rule.

Trait Implementations§

Source§

impl Clone for AggregateRule

Source§

fn clone(&self) -> AggregateRule

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 AggregateRule

Source§

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

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

impl Eq for AggregateRule

Source§

impl PartialEq for AggregateRule

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for AggregateRule

Auto Trait Implementations§

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.