pub struct ConditionStack { /* private fields */ }Expand description
A stack of ConditionHandlers, searched innermost-first on signal.
Models the dynamic-extent handler chain of the condition system; signalling dispatches to the nearest handler whose kind matches.
Implementations§
Source§impl ConditionStack
impl ConditionStack
Sourcepub fn push(&mut self, handler: ConditionHandler)
pub fn push(&mut self, handler: ConditionHandler)
Installs handler as the new innermost handler.
Sourcepub fn pop(&mut self) -> Option<ConditionHandler>
pub fn pop(&mut self) -> Option<ConditionHandler>
Removes and returns the innermost handler, if any.
Sourcepub fn signal(
&self,
cx: &mut Cx,
condition: Condition,
) -> Result<ContinuationValue>
pub fn signal( &self, cx: &mut Cx, condition: Condition, ) -> Result<ContinuationValue>
Signals condition, capturing against the nearest matching handler and
returning the resulting ContinuationValue.
Fails with Error::Eval when no handler
matches the condition kind.
Sourcepub fn nearest_handler(&self, kind: &Symbol) -> Result<&ConditionHandler>
pub fn nearest_handler(&self, kind: &Symbol) -> Result<&ConditionHandler>
Returns the innermost handler matching kind, or
Error::Eval when none is installed.
Trait Implementations§
Source§impl Clone for ConditionStack
impl Clone for ConditionStack
Source§fn clone(&self) -> ConditionStack
fn clone(&self) -> ConditionStack
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 ConditionStack
impl Debug for ConditionStack
Source§impl Default for ConditionStack
impl Default for ConditionStack
Source§fn default() -> ConditionStack
fn default() -> ConditionStack
Returns the “default value” for a type. Read more
impl Eq for ConditionStack
Source§impl PartialEq for ConditionStack
impl PartialEq for ConditionStack
Source§fn eq(&self, other: &ConditionStack) -> bool
fn eq(&self, other: &ConditionStack) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ConditionStack
Auto Trait Implementations§
impl Freeze for ConditionStack
impl RefUnwindSafe for ConditionStack
impl Send for ConditionStack
impl Sync for ConditionStack
impl Unpin for ConditionStack
impl UnsafeUnpin for ConditionStack
impl UnwindSafe for ConditionStack
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