pub trait AsBinding {
// Required methods
fn variables(&self) -> Vec<u32>;
fn binds(&self, variable: u32) -> Option<usize>;
fn required_to_extend(
&self,
prefix: &dyn AsBinding,
target: u32,
) -> Option<Option<u32>>;
fn ready_to_extend(&self, prefix: &dyn AsBinding) -> Option<u32>;
// Provided method
fn can_extend(&self, prefix: &dyn AsBinding, target: u32) -> bool { ... }
}Expand description
A thing that can act as a binding of values to variables.
Required Methods§
Sourcefn binds(&self, variable: u32) -> Option<usize>
fn binds(&self, variable: u32) -> Option<usize>
Iff the binding has opinions about the given variable, this will return the offset, otherwise None.
Sourcefn required_to_extend(
&self,
prefix: &dyn AsBinding,
target: u32,
) -> Option<Option<u32>>
fn required_to_extend( &self, prefix: &dyn AsBinding, target: u32, ) -> Option<Option<u32>>
Returns an optional variable which must be bound by the prefix in order for this binding to extend the prefix. If None, then this binding can never be used to extend the prefix to the specified variable (e.g. because it doesn’t even bind it).
Sourcefn ready_to_extend(&self, prefix: &dyn AsBinding) -> Option<u32>
fn ready_to_extend(&self, prefix: &dyn AsBinding) -> Option<u32>
Returns an optional variable by which this binding could extend the given prefix.
Provided Methods§
Sourcefn can_extend(&self, prefix: &dyn AsBinding, target: u32) -> bool
fn can_extend(&self, prefix: &dyn AsBinding, target: u32) -> bool
Returns true iff the binding is ready to participate in the extension of a set of prefix variables to a new variable.