pub struct AltMatch {
pub p: Option<String>,
pub r: Option<String>,
pub b: usize,
pub n: HashMap<String, i32>,
pub u: HashMap<String, Value>,
pub k: HashMap<String, Value>,
pub g: Vec<String>,
pub e: Option<Box<Token>>,
pub h: Option<AltModifierWithMatch>,
pub actions: Vec<AltActionBinding>,
pub action_configs: HashMap<String, Value>,
}Expand description
Effective result of matching one alternate. Dynamic error/routing/backtrack
callbacks are resolved into this record before the modifier runs, matching
TypeScript’s AltMatch contract.
Fields§
§p: Option<String>§r: Option<String>§b: usize§n: HashMap<String, i32>§u: HashMap<String, Value>§k: HashMap<String, Value>§g: Vec<String>§e: Option<Box<Token>>The alternate’s error token, boxed. A Token is 248 bytes and this
record is moved twice per rule step, so carrying one inline made
AltMatch 560 bytes of which 248 were an error almost no alternate
raises. The box costs an allocation only on the error path, which
is already the expensive one.
h: Option<AltModifierWithMatch>Canonical post-match modifier attached to the selected alternate. It remains visible to the modifier itself and later actions even though changing it after selection does not rerun the phase.
actions: Vec<AltActionBinding>§action_configs: HashMap<String, Value>Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for AltMatch
impl !UnwindSafe for AltMatch
impl Freeze for AltMatch
impl Send for AltMatch
impl Sync for AltMatch
impl Unpin for AltMatch
impl UnsafeUnpin for AltMatch
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