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
impl MatchShape
pub fn num_vars(&self) -> usize
pub fn num_seq_vars(&self) -> usize
pub fn num_set_vars(&self) -> usize
pub fn num_mset_vars(&self) -> usize
pub fn num_mult_vars(&self) -> usize
pub fn num_lit_val_vars(&self) -> usize
pub fn var_ids(&self) -> impl Iterator<Item = VarId>
pub fn seq_var_ids(&self) -> impl Iterator<Item = SeqVarId>
pub fn set_var_ids(&self) -> impl Iterator<Item = SetVarId>
pub fn mset_var_ids(&self) -> impl Iterator<Item = MsetVarId>
pub fn mult_var_ids(&self) -> impl Iterator<Item = MultVarId>
pub fn lit_val_var_ids(&self) -> impl Iterator<Item = LitValVarId>
pub fn var_name(&self, v: VarId) -> &str
pub fn seq_name(&self, v: SeqVarId) -> &str
pub fn set_name(&self, v: SetVarId) -> &str
pub fn mset_name(&self, v: MsetVarId) -> &str
pub fn mult_name(&self, v: MultVarId) -> &str
pub fn lit_val_name(&self, v: LitValVarId) -> &str
pub fn find_var(&self, name: &str) -> Option<VarId>
pub fn find_seq(&self, name: &str) -> Option<SeqVarId>
pub fn find_set(&self, name: &str) -> Option<SetVarId>
pub fn find_mset(&self, name: &str) -> Option<MsetVarId>
pub fn find_mult(&self, name: &str) -> Option<MultVarId>
pub fn find_lit_val(&self, name: &str) -> Option<LitValVarId>
Sourcepub fn intern_mult(&mut self, name: &str) -> Result<MultVarId, String>
pub fn intern_mult(&mut self, name: &str) -> Result<MultVarId, String>
Register a new mult variable (for comprehension bindings). Returns existing if already present.
pub fn intern_var(&mut self, name: &str) -> Result<VarId, String>
pub fn intern_seq(&mut self, name: &str) -> Result<SeqVarId, String>
pub fn intern_set(&mut self, name: &str) -> Result<SetVarId, String>
pub fn intern_mset(&mut self, name: &str) -> Result<MsetVarId, String>
pub fn intern_lit_val(&mut self, name: &str) -> Result<LitValVarId, String>
pub fn vars(&self) -> impl Iterator<Item = (&str, VarId)>
pub fn seq_pairs(&self) -> impl Iterator<Item = (&str, SeqVarId)>
pub fn set_pairs(&self) -> impl Iterator<Item = (&str, SetVarId)>
pub fn mset_pairs(&self) -> impl Iterator<Item = (&str, MsetVarId)>
pub fn mult_pairs(&self) -> impl Iterator<Item = (&str, MultVarId)>
pub fn lit_val_pairs(&self) -> impl Iterator<Item = (&str, LitValVarId)>
Trait Implementations§
Source§impl Clone for MatchShape
impl Clone for MatchShape
Source§impl Debug for MatchShape
impl Debug for MatchShape
Auto Trait Implementations§
impl Freeze for MatchShape
impl RefUnwindSafe for MatchShape
impl Send for MatchShape
impl Sync for MatchShape
impl Unpin for MatchShape
impl UnsafeUnpin for MatchShape
impl UnwindSafe for MatchShape
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