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: u64The product of the charset sizes: the distinct combinations.
Implementations§
Source§impl ParsedCombinations
impl ParsedCombinations
Sourcepub fn from_pattern(pattern: &str) -> Self
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.