pub struct RootCause { /* private fields */ }Expand description
Captures the first fatal error and coordinates process-wide stop.
Implementations§
Source§impl RootCause
impl RootCause
Sourcepub fn new(stop: Arc<AtomicBool>) -> Self
pub fn new(stop: Arc<AtomicBool>) -> Self
Create a new root-cause recorder tied to a shared stop flag.
Sourcepub fn request_stop(&self)
pub fn request_stop(&self)
Request stop (idempotent).
Sourcepub fn stop_requested(&self) -> bool
pub fn stop_requested(&self) -> bool
Whether stop has been requested.
Sourcepub fn record_error(&self, who: &'static str, err: impl Display)
pub fn record_error(&self, who: &'static str, err: impl Display)
Record the first fatal error and request stop.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RootCause
impl RefUnwindSafe for RootCause
impl Send for RootCause
impl Sync for RootCause
impl Unpin for RootCause
impl UnwindSafe for RootCause
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