Struct unwind_context::StdPanicDetector
source · pub struct StdPanicDetector;
Available on crate feature
std
only.Expand description
A default PanicDetector
for a crates compiled with the Rust standard
library.
It uses std::thread::panicking()
to detect whether the current thread is
unwinding because of panic.
§Examples
use unwind_context::unwind_context_with_fmt;
fn func(foo: u32, bar: &str, writer: &mut String) {
let ctx = unwind_context_with_fmt!(
(foo, bar),
writer = writer,
panic_detector = unwind_context::StdPanicDetector,
);
// ...
}
Trait Implementations§
source§impl Clone for StdPanicDetector
impl Clone for StdPanicDetector
source§fn clone(&self) -> StdPanicDetector
fn clone(&self) -> StdPanicDetector
Returns a copy 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 moresource§impl Debug for StdPanicDetector
impl Debug for StdPanicDetector
source§impl Hash for StdPanicDetector
impl Hash for StdPanicDetector
source§impl Ord for StdPanicDetector
impl Ord for StdPanicDetector
source§fn cmp(&self, other: &StdPanicDetector) -> Ordering
fn cmp(&self, other: &StdPanicDetector) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PanicDetector for StdPanicDetector
impl PanicDetector for StdPanicDetector
source§fn is_panicking(&self) -> bool
fn is_panicking(&self) -> bool
Determines whether the current thread is unwinding because of panic. Read more
source§impl PartialEq for StdPanicDetector
impl PartialEq for StdPanicDetector
source§fn eq(&self, other: &StdPanicDetector) -> bool
fn eq(&self, other: &StdPanicDetector) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for StdPanicDetector
impl PartialOrd for StdPanicDetector
source§fn partial_cmp(&self, other: &StdPanicDetector) -> Option<Ordering>
fn partial_cmp(&self, other: &StdPanicDetector) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for StdPanicDetector
impl Eq for StdPanicDetector
impl StructuralPartialEq for StdPanicDetector
Auto Trait Implementations§
impl RefUnwindSafe for StdPanicDetector
impl Send for StdPanicDetector
impl Sync for StdPanicDetector
impl Unpin for StdPanicDetector
impl UnwindSafe for StdPanicDetector
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