pub struct GenerationConstraints {
pub mutex: Vec<Vec<ChoiceRef>>,
pub requires: Vec<(ChoiceRef, ChoiceRef)>,
pub exclude: Vec<(ChoiceRef, ChoiceRef)>,
}Expand description
Declarative pruning constraints applied to the enumerated variant set BEFORE materialization.
All three keywords are read off the same (dimension, label) coordinate space (ChoiceRef):
mutex— the FULL group may not all co-occur in one variant (a group of 2+ refs); a variant is pruned only when every member is present. For a PAIR this is “the two may not co-occur”; for 3+ members only the single all-present variant is forbidden, every proper subset survives.requires— choosing the first ref of a pair requires the second to be present too.exclude— the first and second ref of a pair may not both be present.
The keywords mirror the nirs4all generation oracle’s _mutex_ / _requires_ / _exclude_. The
oracle’s fourth keyword _depends_on_ is a DEAD keyword with no filter semantics and is omitted
here on purpose.
ADDITIVE: every field is skip_serializing_if = "Vec::is_empty" and the whole value is skipped
when empty on GenerationSpec, so a constraint-free spec serializes byte-identically to before
this field existed (its fingerprint is unchanged).
Fields§
§mutex: Vec<Vec<ChoiceRef>>Mutual-exclusion groups: the FULL group may not all co-occur in one variant (matching the
nirs4all legacy issubset rule). A variant is pruned only when every member is present —
for a pair this is “not both”, for 3+ only the all-present variant drops (subsets survive).
requires: Vec<(ChoiceRef, ChoiceRef)>Dependency pairs (a, b): if a is present, b must also be present.
exclude: Vec<(ChoiceRef, ChoiceRef)>Forbidden pairs (a, b): a and b may not both be present.
Implementations§
Trait Implementations§
Source§impl Clone for GenerationConstraints
impl Clone for GenerationConstraints
Source§fn clone(&self) -> GenerationConstraints
fn clone(&self) -> GenerationConstraints
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GenerationConstraints
impl Debug for GenerationConstraints
Source§impl Default for GenerationConstraints
impl Default for GenerationConstraints
Source§fn default() -> GenerationConstraints
fn default() -> GenerationConstraints
Source§impl<'de> Deserialize<'de> for GenerationConstraints
impl<'de> Deserialize<'de> for GenerationConstraints
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<GenerationConstraints, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<GenerationConstraints, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for GenerationConstraints
Source§impl PartialEq for GenerationConstraints
impl PartialEq for GenerationConstraints
Source§fn eq(&self, other: &GenerationConstraints) -> bool
fn eq(&self, other: &GenerationConstraints) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for GenerationConstraints
impl Serialize for GenerationConstraints
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for GenerationConstraints
Auto Trait Implementations§
impl Freeze for GenerationConstraints
impl RefUnwindSafe for GenerationConstraints
impl Send for GenerationConstraints
impl Sync for GenerationConstraints
impl Unpin for GenerationConstraints
impl UnsafeUnpin for GenerationConstraints
impl UnwindSafe for GenerationConstraints
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.