pub struct SetConstraint<S: ValueSchema, R, T>{ /* private fields */ }Expand description
Constrains a variable to values present in a HashSet.
Created via the ContainsConstraint trait (.has(variable)).
Proposals enumerate every element in the set; confirmations retain
only proposals that the set contains. Accepts &HashSet<T>,
Rc<HashSet<T>>, and Arc<HashSet<T>> as the backing store.
Implementations§
Source§impl<S: ValueSchema, R, T> SetConstraint<S, R, T>
impl<S: ValueSchema, R, T> SetConstraint<S, R, T>
Trait Implementations§
Source§impl<'a, S: ValueSchema, R, T> Constraint<'a> for SetConstraint<S, R, T>
impl<'a, S: ValueSchema, R, T> Constraint<'a> for SetConstraint<S, R, T>
Source§fn variables(&self) -> VariableSet
fn variables(&self) -> VariableSet
Returns the set of variables this constraint touches. 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>, )
Source§fn confirm(
&self,
variable: VariableId,
_binding: &Binding,
proposals: &mut Vec<RawValue>,
)
fn confirm( &self, variable: VariableId, _binding: &Binding, proposals: &mut Vec<RawValue>, )
Source§fn satisfied(&self, _binding: &Binding) -> bool
fn satisfied(&self, _binding: &Binding) -> bool
Returns whether this constraint is consistent with the current
binding. Read moreSource§fn influence(&self, variable: VariableId) -> VariableSet
fn influence(&self, variable: VariableId) -> VariableSet
Returns the set of variables whose estimates may change when
variable is bound or unbound. Read moreAuto Trait Implementations§
impl<S, R, T> Freeze for SetConstraint<S, R, T>where
R: Freeze,
impl<S, R, T> RefUnwindSafe for SetConstraint<S, R, T>where
R: RefUnwindSafe,
S: RefUnwindSafe,
impl<S, R, T> Send for SetConstraint<S, R, T>
impl<S, R, T> Sync for SetConstraint<S, R, T>
impl<S, R, T> Unpin for SetConstraint<S, R, T>
impl<S, R, T> UnsafeUnpin for SetConstraint<S, R, T>where
R: UnsafeUnpin,
impl<S, R, T> UnwindSafe for SetConstraint<S, R, T>where
R: UnwindSafe,
S: UnwindSafe,
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