pub struct EffectHandler { /* private fields */ }Expand description
An effect handler that processes effects according to a policy.
Implementations§
Source§impl EffectHandler
impl EffectHandler
Sourcepub fn new(policy: EffectPolicy) -> Self
pub fn new(policy: EffectPolicy) -> Self
Create a new effect handler with the given policy.
Sourcepub fn collect_all() -> Self
pub fn collect_all() -> Self
Create an effect handler that collects all effects.
Sourcepub fn fail_on_terminal() -> Self
pub fn fail_on_terminal() -> Self
Create an effect handler that fails on terminal effects only.
Sourcepub fn handle(&mut self, effect: ParserEffect) -> Result<(), ParserEffect>
pub fn handle(&mut self, effect: ParserEffect) -> Result<(), ParserEffect>
Handle an effect, returning Err if the policy requires immediate failure.
Sourcepub fn trace(&self) -> &EffectTrace
pub fn trace(&self) -> &EffectTrace
Get the current effect trace.
Sourcepub fn into_trace(self) -> EffectTrace
pub fn into_trace(self) -> EffectTrace
Consume the handler and return the effect trace.
Sourcepub fn summary(&self) -> EffectTraceSummary
pub fn summary(&self) -> EffectTraceSummary
Get a summary of the effects.
Trait Implementations§
Source§impl Clone for EffectHandler
impl Clone for EffectHandler
Source§fn clone(&self) -> EffectHandler
fn clone(&self) -> EffectHandler
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EffectHandler
impl Debug for EffectHandler
Auto Trait Implementations§
impl Freeze for EffectHandler
impl RefUnwindSafe for EffectHandler
impl Send for EffectHandler
impl Sync for EffectHandler
impl Unpin for EffectHandler
impl UnsafeUnpin for EffectHandler
impl UnwindSafe for EffectHandler
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