pub struct ErrorHook {
pub error: RuntimeError,
/* private fields */
}
Expand description
The environment given to the error handler.
This deliberately does not implement Clone to make it hard to move it out of the handler, which you should not do.
The ErrorHook::critical()
method should be used to send a CriticalError
, which will
terminate watchexec. This is useful to e.g. upgrade certain errors to be fatal.
Note that returning errors from the error handler does not result in critical errors.
Fields
error: RuntimeError
The runtime error for which this handler was called.
Implementations
sourceimpl ErrorHook
impl ErrorHook
sourcepub fn critical(self, critical: CriticalError)
pub fn critical(self, critical: CriticalError)
Set a critical error to be emitted.
This takes self
and ErrorHook
is not Clone
, so it’s only possible to call it once.
Regardless, if you do manage to call it twice, it will do nothing beyond the first call.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for ErrorHook
impl Send for ErrorHook
impl Sync for ErrorHook
impl Unpin for ErrorHook
impl !UnwindSafe for ErrorHook
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more