Trait AsBinding

Source
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§

Source

fn variables(&self) -> Vec<u32>

All variables bound by this binding.

Source

fn binds(&self, variable: u32) -> Option<usize>

Iff the binding has opinions about the given variable, this will return the offset, otherwise None.

Source

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).

Source

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§

Source

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.

Implementations on Foreign Types§

Source§

impl AsBinding for Vec<u32>

Source§

fn variables(&self) -> Vec<u32>

Source§

fn binds(&self, variable: u32) -> Option<usize>

Source§

fn ready_to_extend(&self, _prefix: &dyn AsBinding) -> Option<u32>

Source§

fn required_to_extend( &self, _prefix: &dyn AsBinding, _target: u32, ) -> Option<Option<u32>>

Implementors§