pub struct ValueRange { /* private fields */ }Expand description
Restricts a variable’s raw value to a byte-lexicographic range.
This constraint only confirms — it never proposes candidates.
Use it with and! alongside a constraint that does
propose (e.g. a pattern!):
ⓘ
find!((id: Id, ts: Value<NsTAIInterval>),
and!(
pattern!(data, [{ ?id @ exec::requested_at: ?ts }]),
value_range(ts, min_ts, max_ts),
)
)The estimate returns usize::MAX so the intersection sorts this
constraint last — the tighter TribleSet constraint proposes first,
then this range constraint filters.
Implementations§
Source§impl ValueRange
impl ValueRange
Trait Implementations§
Source§impl<'a> Constraint<'a> for ValueRange
impl<'a> Constraint<'a> for ValueRange
Source§fn estimate(&self, variable: VariableId, _binding: &Binding) -> Option<usize>
fn estimate(&self, variable: VariableId, _binding: &Binding) -> Option<usize>
Returns usize::MAX so the intersection never chooses this
constraint as the proposer — it only confirms.
Source§fn propose(
&self,
_variable: VariableId,
_binding: &Binding,
_proposals: &mut Vec<RawValue>,
)
fn propose( &self, _variable: VariableId, _binding: &Binding, _proposals: &mut Vec<RawValue>, )
Does not propose — the paired TribleSet constraint handles proposals.
Source§fn confirm(
&self,
variable: VariableId,
_binding: &Binding,
proposals: &mut Vec<RawValue>,
)
fn confirm( &self, variable: VariableId, _binding: &Binding, proposals: &mut Vec<RawValue>, )
Retains only proposals whose raw bytes fall within [min, max] inclusive.
Source§fn satisfied(&self, binding: &Binding) -> bool
fn satisfied(&self, binding: &Binding) -> bool
Returns false when the variable is bound to a value outside the range.
Source§fn variables(&self) -> VariableSet
fn variables(&self) -> VariableSet
Returns the set of variables this constraint touches. Read more
Source§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 Freeze for ValueRange
impl RefUnwindSafe for ValueRange
impl Send for ValueRange
impl Sync for ValueRange
impl Unpin for ValueRange
impl UnsafeUnpin for ValueRange
impl UnwindSafe for ValueRange
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