Skip to main content

ParsedCombinations

Struct ParsedCombinations 

Source
pub struct ParsedCombinations {
    pub segments: Vec<Segment>,
    pub modulus: u64,
}
Expand description

Map a u64 to a formatted string via mixed-radix indexing into character sets.

Signature: combinations(input: u64, pattern: &str) -> (String)

The pattern is a semicolon-delimited list of character set specs. Each spec is a character range (A-Z), literal characters, or both. A single literal character (like -) is emitted as-is without consuming a radix digit.

Use for generating structured identifiers with fixed character classes per position. Examples: phone numbers ("0-9;0-9;0-9;-;0-9;0-9;0-9;-;0-9;0-9;0-9;0-9" yields "372-841-9205"), license plates ("A-Z;A-Z;A-Z;-;0-9;0-9;0-9"), or hex tokens ("0-9a-f;0-9a-f;0-9a-f;0-9a-f"). Input wraps at cardinality(), so every value in the cycle space maps to a valid string.

JIT level: P1 (String output; no compiled_u64 path). Derived state for combinations. Computed once per node instance via from_pattern; the macro stores the instance in a struct field and hands the eval body a &ParsedCombinations borrow each call.

Fields§

§segments: Vec<Segment>

The segments, in output order.

§modulus: u64

The product of the charset sizes: the distinct combinations.

Implementations§

Source§

impl ParsedCombinations

Source

pub fn from_pattern(pattern: &str) -> Self

Single-call setup. The #[polydat_node] macro invokes this exactly once in the generated Combinations::new(); no other call path exists.

Trait Implementations§

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<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> 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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.