pub enum Domain<'a> {
Integer {
parameter: &'a ParameterName,
domain: &'a IntegerDomain,
},
Double {
parameter: &'a ParameterName,
domain: &'a DoubleDomain,
},
Boolean {
parameter: &'a ParameterName,
},
String {
parameter: &'a ParameterName,
domain: &'a StringDomain,
},
Selection {
parameter: &'a ParameterName,
domain: &'a SelectionDomain,
},
}Expand description
Borrowed view over a parameter’s domain, pinned to the parameter’s
name so operations can produce properly-provenanced Values.
This is a small deviation from SRD-0004 §Domain, which shows the
view enum without the parameter reference. Threading the name
through is the simplest way to let sample, boundary_values, and
enumerate hand back owned Values without asking the caller to
pass the name at every call site.
Variants§
Integer
Integer domain view.
Fields
parameter: &'a ParameterNameOwning parameter’s name.
domain: &'a IntegerDomainBorrowed per-kind domain.
Double
Double domain view.
Fields
parameter: &'a ParameterNameOwning parameter’s name.
domain: &'a DoubleDomainBorrowed per-kind domain.
Boolean
Boolean domain view — no payload.
Fields
parameter: &'a ParameterNameOwning parameter’s name.
String
String domain view.
Fields
parameter: &'a ParameterNameOwning parameter’s name.
domain: &'a StringDomainBorrowed per-kind domain.
Selection
Selection domain view.
Fields
parameter: &'a ParameterNameOwning parameter’s name.
domain: &'a SelectionDomainBorrowed per-kind domain.
Implementations§
Source§impl<'a> Domain<'a>
impl<'a> Domain<'a>
Sourcepub const fn parameter(&self) -> &'a ParameterName
pub const fn parameter(&self) -> &'a ParameterName
The owning parameter’s name.
Sourcepub fn contains(&self, value: &Value) -> bool
pub fn contains(&self, value: &Value) -> bool
Membership test. Kind-mismatched values always return false.
For SelectionDomain::External, only the shape is checked —
full validation requires a resolver and is deferred.
Sourcepub fn cardinality(&self) -> Cardinality
pub fn cardinality(&self) -> Cardinality
Count of distinct values.
Sourcepub fn boundary_values(&self) -> Vec<Value>
pub fn boundary_values(&self) -> Vec<Value>
Boundary values, lifted to Value.