Skip to main content

Module domain

Module domain 

Source
Expand description

Parameter domains.

A domain is the set of values a parameter may legally take. Per SRD-0004 D2 each parameter kind owns a sub-enum of its admissible shapes (IntegerDomain, DoubleDomain, StringDomain, SelectionDomain; Boolean has no payload), and a view enum Domain borrows into whichever sub-enum a Parameter carries. This module defines the owned sub-enums, their native-type operations (membership, cardinality, boundaries, sampling, enumeration), the Domain view wrapper that lifts those ops into Value form, and the SelectionResolver trait the Selection External variant defers to at plan-compilation time.

Gaps flagged for later SRD revisions:

  • StringDomain::Regex sampling. The regex crate does not provide regex-backed generation; a future slice can plug in a generator crate or defer sampling to the caller. Until then, Domain::sample panics for the Regex variant.
  • SelectionDomain::External sampling. Registry-aware sampling is specified in SRD-0004 D15 but not yet wired up; Domain::sample panics for the External variant.

Structs§

LabeledEntry
Label attached to an external selection value for display purposes.
RegexPattern
A validated regex, carrying both the source pattern and the compiled automaton.
ResolverId
Opaque identifier naming an external selection resolver.

Enums§

Cardinality
How many distinct values a domain contains.
Domain
Borrowed view over a parameter’s domain, pinned to the parameter’s name so operations can produce properly-provenanced Values.
DomainError
Errors produced by domain constructors and operations.
DoubleDomain
Double-precision float domain: inclusive range with finite, non-NaN bounds.
IntegerDomain
Integer domain: either an inclusive numeric range or a finite discrete set.
SelectionDomain
Selection domain: a set the user can pick multiple items from.
StringDomain
String domain: accept-all or regex-matched.

Traits§

LabeledSelectionResolver
Extension trait: values carry UI labels in addition to their canonical ids.
SelectionResolver
Resolves the set of valid values for one external selection.
SelectionResolverRegistry
Host registry. The host (typically the embedding system) provides an implementation that knows how to look up resolvers by id.