pub struct Trigger { /* private fields */ }Expand description
A parsed condition set: the core group and any alternative groups.
Implementations§
Source§impl Trigger
impl Trigger
Sourcepub fn parse(source: &str) -> Result<Self, ParseError>
pub fn parse(source: &str) -> Result<Self, ParseError>
Parse a condition set (see the module docs for the grammar).
§Errors
ParseError naming the first piece that is malformed or unsupported.
Sourcepub fn evaluate(
&mut self,
armed: bool,
read: &mut impl FnMut(u32) -> u8,
) -> bool
pub fn evaluate( &mut self, armed: bool, read: &mut impl FnMut(u32) -> u8, ) -> bool
Evaluate the set against memory. When armed, hit counts advance and
the result is returned; when not, the conditions are only sampled (so
their d / p history stays one frame deep) and the result is
false. Either way the operand history then advances.
Sourcepub fn reset_hits(&mut self)
pub fn reset_hits(&mut self)
Clear the hit counts (the trigger is re-armed from zero).
Trait Implementations§
impl Eq for Trigger
impl StructuralPartialEq for Trigger
Auto Trait Implementations§
impl Freeze for Trigger
impl RefUnwindSafe for Trigger
impl Send for Trigger
impl Sync for Trigger
impl Unpin for Trigger
impl UnsafeUnpin for Trigger
impl UnwindSafe for Trigger
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