pub struct Bug(_);
Expand description
Programming error (a bug)
Implementations
sourceimpl Bug
impl Bug
sourcepub fn new<S: Into<String>>(kind: ErrorKind, message: S) -> Self
pub fn new<S: Into<String>>(kind: ErrorKind, message: S) -> Self
Create a bug error report capturing this call site and backtrace
Prefer to use internal!
,
as that makes it easy to add additional information
via format parameters.
sourcepub fn from_error<E, S>(kind: ErrorKind, source: E, message: S) -> Self where
S: Into<String>,
E: Error + Send + Sync + 'static,
pub fn from_error<E, S>(kind: ErrorKind, source: E, message: S) -> Self where
S: Into<String>,
E: Error + Send + Sync + 'static,
Create an bug error report from another error, capturing this call site and backtrace
In map_err
, and perhaps elsewhere, prefer to use into_internal!
,
as that makes it easy to add additional information
via format parameters.
Trait Implementations
sourceimpl Error for Bug
impl Error for Bug
sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
🔬 This is a nightly-only experimental API. (
backtrace
)Returns a stack backtrace, if available, of where this error occurred. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
👎 Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations
impl !RefUnwindSafe for Bug
impl Send for Bug
impl Sync for Bug
impl Unpin for Bug
impl !UnwindSafe for Bug
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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