pub struct RuleSpec {Show 19 fields
pub name: String,
pub open: Vec<AltSpec>,
pub close: Vec<AltSpec>,
pub bo: Vec<String>,
pub ao: Vec<String>,
pub bc: Vec<String>,
pub ac: Vec<String>,
pub bo_fns: Vec<ContextAction>,
pub ao_fns: Vec<ContextAction>,
pub bc_fns: Vec<ContextAction>,
pub ac_fns: Vec<ContextAction>,
pub bo_state_fns: Vec<StateAction>,
pub ao_state_fns: Vec<StateAction>,
pub bc_state_fns: Vec<StateAction>,
pub ac_state_fns: Vec<StateAction>,
pub bo_order: Vec<ActionBinding>,
pub ao_order: Vec<ActionBinding>,
pub bc_order: Vec<ActionBinding>,
pub ac_order: Vec<ActionBinding>,
}Fields§
§name: String§open: Vec<AltSpec>§close: Vec<AltSpec>§bo: Vec<String>§ao: Vec<String>§bc: Vec<String>§ac: Vec<String>§bo_fns: Vec<ContextAction>Imperative lifecycle callbacks, parallel to the named serialized callback lists above.
ao_fns: Vec<ContextAction>§bc_fns: Vec<ContextAction>§ac_fns: Vec<ContextAction>§bo_state_fns: Vec<StateAction>§ao_state_fns: Vec<StateAction>§bc_state_fns: Vec<StateAction>§ac_state_fns: Vec<StateAction>§bo_order: Vec<ActionBinding>§ao_order: Vec<ActionBinding>§bc_order: Vec<ActionBinding>§ac_order: Vec<ActionBinding>Implementations§
Source§impl RuleSpec
impl RuleSpec
pub fn new(name: impl Into<String>) -> Self
Sourcepub fn clear(&mut self) -> &mut Self
pub fn clear(&mut self) -> &mut Self
Remove all alternates and lifecycle actions from this rule.
pub fn add_open(&mut self, alt: AltSpec) -> &mut Self
pub fn prepend_open(&mut self, alt: AltSpec) -> &mut Self
pub fn add_close(&mut self, alt: AltSpec) -> &mut Self
pub fn prepend_close(&mut self, alt: AltSpec) -> &mut Self
pub fn clear_open(&mut self) -> &mut Self
pub fn clear_close(&mut self) -> &mut Self
Sourcepub fn modify_open(&mut self, mods: &ListMods<AltSpec>) -> &mut Self
pub fn modify_open(&mut self, mods: &ListMods<AltSpec>) -> &mut Self
Delete then move entries using the same signed-index rules as the
serialized grammar inject object.
pub fn modify_close(&mut self, mods: &ListMods<AltSpec>) -> &mut Self
pub fn add_bo( &mut self, action: impl Fn(&mut Rule, &mut Context) + Send + Sync + 'static, ) -> &mut Self
pub fn prepend_bo( &mut self, action: impl Fn(&mut Rule, &mut Context) + Send + Sync + 'static, ) -> &mut Self
pub fn add_ao( &mut self, action: impl Fn(&mut Rule, &mut Context) + Send + Sync + 'static, ) -> &mut Self
pub fn prepend_ao( &mut self, action: impl Fn(&mut Rule, &mut Context) + Send + Sync + 'static, ) -> &mut Self
pub fn add_bc( &mut self, action: impl Fn(&mut Rule, &mut Context) + Send + Sync + 'static, ) -> &mut Self
pub fn prepend_bc( &mut self, action: impl Fn(&mut Rule, &mut Context) + Send + Sync + 'static, ) -> &mut Self
pub fn add_ac( &mut self, action: impl Fn(&mut Rule, &mut Context) + Send + Sync + 'static, ) -> &mut Self
pub fn prepend_ac( &mut self, action: impl Fn(&mut Rule, &mut Context) + Send + Sync + 'static, ) -> &mut Self
pub fn add_bo_result(&mut self, action: ContextAction) -> &mut Self
pub fn add_ao_result(&mut self, action: ContextAction) -> &mut Self
pub fn add_bc_result(&mut self, action: ContextAction) -> &mut Self
pub fn add_ac_result(&mut self, action: ContextAction) -> &mut Self
pub fn add_bo_with_state(&mut self, action: StateAction) -> &mut Self
pub fn prepend_bo_with_state(&mut self, action: StateAction) -> &mut Self
pub fn add_ao_with_state(&mut self, action: StateAction) -> &mut Self
pub fn prepend_ao_with_state(&mut self, action: StateAction) -> &mut Self
pub fn add_bc_with_state(&mut self, action: StateAction) -> &mut Self
pub fn prepend_bc_with_state(&mut self, action: StateAction) -> &mut Self
pub fn add_ac_with_state(&mut self, action: StateAction) -> &mut Self
pub fn prepend_ac_with_state(&mut self, action: StateAction) -> &mut Self
pub fn add_bo_ref(&mut self, action: impl Into<String>) -> &mut Self
pub fn prepend_bo_ref(&mut self, action: impl Into<String>) -> &mut Self
pub fn add_ao_ref(&mut self, action: impl Into<String>) -> &mut Self
pub fn prepend_ao_ref(&mut self, action: impl Into<String>) -> &mut Self
pub fn add_bc_ref(&mut self, action: impl Into<String>) -> &mut Self
pub fn prepend_bc_ref(&mut self, action: impl Into<String>) -> &mut Self
pub fn add_ac_ref(&mut self, action: impl Into<String>) -> &mut Self
pub fn prepend_ac_ref(&mut self, action: impl Into<String>) -> &mut Self
Sourcepub fn clear_actions(&mut self, phases: &[&str]) -> &mut Self
pub fn clear_actions(&mut self, phases: &[&str]) -> &mut Self
Clear named and imperative lifecycle actions. An empty phase slice
clears all four; otherwise accepted phase names are bo, ao, bc,
and ac.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for RuleSpec
impl !UnwindSafe for RuleSpec
impl Freeze for RuleSpec
impl Send for RuleSpec
impl Sync for RuleSpec
impl Unpin for RuleSpec
impl UnsafeUnpin for RuleSpec
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