pub enum ConstraintEnum<D: Domain> {
NotEqual(NotEqual),
AllDifferent(AllDifferent),
AllDifferentExcept(AllDifferentExcept<D::Value>),
Custom(Box<dyn Constraint<D>>),
}Expand description
Enum-dispatched constraint storage. Avoids vtable indirection for built-in types.
There is deliberately no Lambda variant: every closure-based constraint
(add_equals, add_less_than, add_greater_than, and external
LambdaConstraints) enters through Custom, which boxes
the dyn Constraint. A devirtualized Lambda arm carried zero
construction sites (Pass-1 R1) and was excised; W10 may re-introduce it
behind profiling if the boxed dispatch shows up hot.
Variants§
NotEqual(NotEqual)
AllDifferent(AllDifferent)
AllDifferentExcept(AllDifferentExcept<D::Value>)
Custom(Box<dyn Constraint<D>>)
Implementations§
Source§impl<D: Domain> ConstraintEnum<D>
impl<D: Domain> ConstraintEnum<D>
Trait Implementations§
Auto Trait Implementations§
impl<D> !RefUnwindSafe for ConstraintEnum<D>
impl<D> !Send for ConstraintEnum<D>
impl<D> !Sync for ConstraintEnum<D>
impl<D> !UnwindSafe for ConstraintEnum<D>
impl<D> Freeze for ConstraintEnum<D>
impl<D> Unpin for ConstraintEnum<D>
impl<D> UnsafeUnpin for ConstraintEnum<D>
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