pub enum SupervisorAction {
Restart,
Escalate,
Ignore,
}Expand description
The action a Supervisor takes when a child machine fails.
Variants§
Restart
Restart the failed child machine from its initial state.
The child is re-initialized and begins executing again. Other
children are unaffected (unless RestartStrategy::OneForAll
or RestartStrategy::RestForOne is in effect).
Escalate
Stop the failed child and propagate the error up the supervision tree.
Use this when a child failure is unrecoverable and the parent supervisor (or the top-level caller) should handle it.
Ignore
Ignore the failure and let the child remain in its failed state.
The child is not restarted. This is appropriate for non-critical background tasks whose failure does not affect the overall system.
Trait Implementations§
Source§impl Clone for SupervisorAction
impl Clone for SupervisorAction
Source§fn clone(&self) -> SupervisorAction
fn clone(&self) -> SupervisorAction
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SupervisorAction
impl RefUnwindSafe for SupervisorAction
impl Send for SupervisorAction
impl Sync for SupervisorAction
impl Unpin for SupervisorAction
impl UnsafeUnpin for SupervisorAction
impl UnwindSafe for SupervisorAction
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