pub struct DebugConstraint<C> {
pub constraint: C,
pub record: Rc<RefCell<Vec<VariableId>>>,
}Fields§
§constraint: C§record: Rc<RefCell<Vec<VariableId>>>Implementations§
Source§impl<C> DebugConstraint<C>
impl<C> DebugConstraint<C>
Trait Implementations§
Source§impl<'a, C: Constraint<'a>> Constraint<'a> for DebugConstraint<C>
impl<'a, C: Constraint<'a>> Constraint<'a> for DebugConstraint<C>
Source§fn variables(&self) -> VariableSet
fn variables(&self) -> VariableSet
Return the set of variables used by the constraint.
This is only called once at the beginning of the query.
The query engine uses this information to keep track of the variables
that are used by each constraint.
Source§fn estimate(&self, variable: VariableId, binding: &Binding) -> Option<usize>
fn estimate(&self, variable: VariableId, binding: &Binding) -> Option<usize>
Estimate the number of values that match the constraint.
This is used by the query engine to guide the search.
The estimate should be as accurate as possible, while being cheap to compute,
and is not required to be exact or a permissible heuristic.
The binding passed to the method contains the values assigned to the variables so far. Read more
Source§fn propose(
&self,
variable: VariableId,
binding: &Binding,
proposals: &mut Vec<RawValue>,
)
fn propose( &self, variable: VariableId, binding: &Binding, proposals: &mut Vec<RawValue>, )
Propose values for a variable that match the constraint.
This is used by the query engine to explore the search space.
The method should add values to the
proposals vector that match the constraint.
The binding passed to the method contains the values assigned to the variables so far. Read moreSource§fn confirm(
&self,
variable: VariableId,
binding: &Binding,
proposals: &mut Vec<RawValue>,
)
fn confirm( &self, variable: VariableId, binding: &Binding, proposals: &mut Vec<RawValue>, )
Confirm a value for a variable that matches the constraint.
This is used by the query engine to prune the search space, and confirm that a value satisfies the constraint.
The method should remove values from the
proposals vector that do not match the constraint.
The binding passed to the method contains the values assigned to the variables so far. Read moreSource§fn influence(&self, variable: VariableId) -> VariableSet
fn influence(&self, variable: VariableId) -> VariableSet
Return the set of variables potentially influenced when the passed
variable is bound or unbound. Read more
Auto Trait Implementations§
impl<C> Freeze for DebugConstraint<C>where
C: Freeze,
impl<C> !RefUnwindSafe for DebugConstraint<C>
impl<C> !Send for DebugConstraint<C>
impl<C> !Sync for DebugConstraint<C>
impl<C> Unpin for DebugConstraint<C>where
C: Unpin,
impl<C> UnsafeUnpin for DebugConstraint<C>where
C: UnsafeUnpin,
impl<C> !UnwindSafe for DebugConstraint<C>
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> 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