pub struct KeysConstraint<S: ValueSchema, R, K, V>{ /* private fields */ }Expand description
Constrains a variable to keys present in a HashMap.
Created via the ContainsConstraint
trait (.has(variable)). Proposals enumerate every key in the map;
confirmations retain only proposals whose key exists. Accepts
&HashMap<K,V>, Rc<HashMap<K,V>>, and Arc<HashMap<K,V>>.
Implementations§
Source§impl<S: ValueSchema, R, K, V> KeysConstraint<S, R, K, V>
impl<S: ValueSchema, R, K, V> KeysConstraint<S, R, K, V>
Trait Implementations§
Source§impl<'a, S: ValueSchema, R, K, V> Constraint<'a> for KeysConstraint<S, R, K, V>
impl<'a, S: ValueSchema, R, K, V> Constraint<'a> for KeysConstraint<S, R, K, V>
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, K, V> Freeze for KeysConstraint<S, R, K, V>where
R: Freeze,
impl<S, R, K, V> RefUnwindSafe for KeysConstraint<S, R, K, V>where
R: RefUnwindSafe,
S: RefUnwindSafe,
impl<S, R, K, V> Send for KeysConstraint<S, R, K, V>
impl<S, R, K, V> Sync for KeysConstraint<S, R, K, V>
impl<S, R, K, V> Unpin for KeysConstraint<S, R, K, V>
impl<S, R, K, V> UnsafeUnpin for KeysConstraint<S, R, K, V>where
R: UnsafeUnpin,
impl<S, R, K, V> UnwindSafe for KeysConstraint<S, R, K, V>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