pub enum Domain {
Range {
min: Bound,
max: Bound,
},
Union(Arc<Vec<Domain>>),
Enumeration(Arc<Vec<LiteralValue>>),
Complement(Box<Domain>),
Unconstrained,
Empty,
}Expand description
Domain specification for valid values
Variants§
Range
A single continuous range
Union(Arc<Vec<Domain>>)
Multiple disjoint ranges
Enumeration(Arc<Vec<LiteralValue>>)
Specific enumerated values only
Complement(Box<Domain>)
Everything except these constraints
Unconstrained
Any value (no constraints)
Empty
Empty domain (no valid values) - represents unsatisfiable constraints
Implementations§
Source§impl Domain
impl Domain
Sourcepub fn is_satisfiable(&self) -> bool
pub fn is_satisfiable(&self) -> bool
Check if this domain is satisfiable (has at least one valid value)
Returns false for Empty domains and empty Enumerations.
Sourcepub fn intersect(&self, other: &Domain) -> Domain
pub fn intersect(&self, other: &Domain) -> Domain
Intersect this domain with another, returning Empty if no overlap
Sourcepub fn contains(&self, value: &LiteralValue) -> bool
pub fn contains(&self, value: &LiteralValue) -> bool
Check if a value is contained in this domain
Trait Implementations§
impl StructuralPartialEq for Domain
Auto Trait Implementations§
impl Freeze for Domain
impl RefUnwindSafe for Domain
impl Send for Domain
impl Sync for Domain
impl Unpin for Domain
impl UnwindSafe for Domain
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more