Skip to main content

MatchShape

Struct MatchShape 

Source
pub struct MatchShape {
    pub nodes: Vec<String>,
    pub seqs: Vec<String>,
    pub sets: Vec<String>,
    pub msets: Vec<String>,
    pub mults: Vec<String>,
    pub lit_vals: Vec<String>,
    /* private fields */
}
Expand description

Describes the shape of a match: per-kind variable info indexed by typed dense id.

This is the single source of truth for what ids are valid and how to safely index into Match and MatchSet objects.

Fields§

§nodes: Vec<String>§seqs: Vec<String>§sets: Vec<String>§msets: Vec<String>§mults: Vec<String>§lit_vals: Vec<String>

Implementations§

Source§

impl MatchShape

Source

pub fn num_vars(&self) -> usize

Source

pub fn num_seq_vars(&self) -> usize

Source

pub fn num_set_vars(&self) -> usize

Source

pub fn num_mset_vars(&self) -> usize

Source

pub fn num_mult_vars(&self) -> usize

Source

pub fn num_lit_val_vars(&self) -> usize

Source

pub fn var_ids(&self) -> impl Iterator<Item = VarId>

Source

pub fn seq_var_ids(&self) -> impl Iterator<Item = SeqVarId>

Source

pub fn set_var_ids(&self) -> impl Iterator<Item = SetVarId>

Source

pub fn mset_var_ids(&self) -> impl Iterator<Item = MsetVarId>

Source

pub fn mult_var_ids(&self) -> impl Iterator<Item = MultVarId>

Source

pub fn lit_val_var_ids(&self) -> impl Iterator<Item = LitValVarId>

Source

pub fn var_name(&self, v: VarId) -> &str

Source

pub fn seq_name(&self, v: SeqVarId) -> &str

Source

pub fn set_name(&self, v: SetVarId) -> &str

Source

pub fn mset_name(&self, v: MsetVarId) -> &str

Source

pub fn mult_name(&self, v: MultVarId) -> &str

Source

pub fn lit_val_name(&self, v: LitValVarId) -> &str

Source

pub fn find_var(&self, name: &str) -> Option<VarId>

Source

pub fn find_seq(&self, name: &str) -> Option<SeqVarId>

Source

pub fn find_set(&self, name: &str) -> Option<SetVarId>

Source

pub fn find_mset(&self, name: &str) -> Option<MsetVarId>

Source

pub fn find_mult(&self, name: &str) -> Option<MultVarId>

Source

pub fn find_lit_val(&self, name: &str) -> Option<LitValVarId>

Source

pub fn intern_mult(&mut self, name: &str) -> Result<MultVarId, String>

Register a new mult variable (for comprehension bindings). Returns existing if already present.

Source

pub fn intern_var(&mut self, name: &str) -> Result<VarId, String>

Source

pub fn intern_seq(&mut self, name: &str) -> Result<SeqVarId, String>

Source

pub fn intern_set(&mut self, name: &str) -> Result<SetVarId, String>

Source

pub fn intern_mset(&mut self, name: &str) -> Result<MsetVarId, String>

Source

pub fn intern_lit_val(&mut self, name: &str) -> Result<LitValVarId, String>

Source

pub fn vars(&self) -> impl Iterator<Item = (&str, VarId)>

Source

pub fn seq_pairs(&self) -> impl Iterator<Item = (&str, SeqVarId)>

Source

pub fn set_pairs(&self) -> impl Iterator<Item = (&str, SetVarId)>

Source

pub fn mset_pairs(&self) -> impl Iterator<Item = (&str, MsetVarId)>

Source

pub fn mult_pairs(&self) -> impl Iterator<Item = (&str, MultVarId)>

Source

pub fn lit_val_pairs(&self) -> impl Iterator<Item = (&str, LitValVarId)>

Trait Implementations§

Source§

impl Clone for MatchShape

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MatchShape

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for MatchShape

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.