pub struct Binding {
pub bound: VariableSet,
/* private fields */
}Expand description
The binding keeps track of the values assigned to variables in a query. It maps variables to values - by their index - via a simple array, and keeps track of which variables are bound. It is used to store intermediate results and to pass information between different constraints. The binding is mutable, as it is modified by the query engine. It is not thread-safe and should not be shared between threads. The binding is a simple data structure that is cheap to clone. It is not intended to be used as a long-term storage for query results.
Fields§
§bound: VariableSetBitset tracking which variables have been assigned a value.
Implementations§
Source§impl Binding
impl Binding
Sourcepub fn set(&mut self, variable: VariableId, value: &RawValue)
pub fn set(&mut self, variable: VariableId, value: &RawValue)
Binds variable to value.
Sourcepub fn unset(&mut self, variable: VariableId)
pub fn unset(&mut self, variable: VariableId)
Unset a variable in the binding. This is used to backtrack in the query engine.
Sourcepub fn get(&self, variable: VariableId) -> Option<&RawValue>
pub fn get(&self, variable: VariableId) -> Option<&RawValue>
Check if a variable is bound in the binding.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Binding
impl RefUnwindSafe for Binding
impl Send for Binding
impl Sync for Binding
impl Unpin for Binding
impl UnsafeUnpin for Binding
impl UnwindSafe for Binding
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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