pub struct BindingSet {
pub variables: SmallVec<[Variable; 8]>,
pub bindings: Vec<TermBinding>,
pub constraints: Vec<Constraint>,
/* private fields */
}
Expand description
Optimized binding set for variable management
Fields§
§variables: SmallVec<[Variable; 8]>
Variables in this binding set (using SmallVec for cache efficiency)
bindings: Vec<TermBinding>
Current bindings
constraints: Vec<Constraint>
Constraints on variables
Implementations§
Source§impl BindingSet
impl BindingSet
Sourcepub fn with_variables(vars: Vec<Variable>) -> Self
pub fn with_variables(vars: Vec<Variable>) -> Self
Create a binding set with initial variables
Sourcepub fn add_variable(&mut self, var: Variable) -> usize
pub fn add_variable(&mut self, var: Variable) -> usize
Add a variable to the binding set
Sourcepub fn bind(
&mut self,
var: Variable,
term: Term,
metadata: BindingMetadata,
) -> Result<(), OxirsError>
pub fn bind( &mut self, var: Variable, term: Term, metadata: BindingMetadata, ) -> Result<(), OxirsError>
Bind a variable to a term
Sourcepub fn unbound_variables(&self) -> Vec<&Variable>
pub fn unbound_variables(&self) -> Vec<&Variable>
Get all unbound variables
Sourcepub fn add_constraint(&mut self, constraint: Constraint)
pub fn add_constraint(&mut self, constraint: Constraint)
Add a constraint
Sourcepub fn merge(&mut self, other: &BindingSet) -> Result<(), OxirsError>
pub fn merge(&mut self, other: &BindingSet) -> Result<(), OxirsError>
Merge another binding set into this one
Sourcepub fn apply_to_pattern(&self, pattern: &TermPattern) -> TermPattern
pub fn apply_to_pattern(&self, pattern: &TermPattern) -> TermPattern
Apply bindings to a term pattern
Trait Implementations§
Source§impl Clone for BindingSet
impl Clone for BindingSet
Source§fn clone(&self) -> BindingSet
fn clone(&self) -> BindingSet
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for BindingSet
impl Debug for BindingSet
Auto Trait Implementations§
impl Freeze for BindingSet
impl RefUnwindSafe for BindingSet
impl Send for BindingSet
impl Sync for BindingSet
impl Unpin for BindingSet
impl UnwindSafe for BindingSet
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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