pub struct DogeError {
pub kind: ErrorKind,
pub message: String,
pub location: Option<ErrorLocation>,
}Expand description
A catchable runtime error: a category plus a precise, plain-English message.
Fields§
§kind: ErrorKind§message: String§location: Option<ErrorLocation>The raise site, carried only across bonk err so a re-raised error keeps
its original location. None on a freshly built error — the catch site
supplies the location when it becomes an error_value.
Implementations§
Source§impl DogeError
impl DogeError
pub fn new(kind: ErrorKind, message: impl Into<String>) -> Self
pub fn type_error(message: impl Into<String>) -> Self
pub fn division_by_zero(message: impl Into<String>) -> Self
pub fn overflow(message: impl Into<String>) -> Self
pub fn index_out_of_bounds(message: impl Into<String>) -> Self
pub fn key_error(message: impl Into<String>) -> Self
pub fn value_error(message: impl Into<String>) -> Self
pub fn attr_error(message: impl Into<String>) -> Self
pub fn io_error(message: impl Into<String>) -> Self
Trait Implementations§
impl Eq for DogeError
Source§impl Error for DogeError
impl Error for DogeError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
impl StructuralPartialEq for DogeError
Auto Trait Implementations§
impl !Send for DogeError
impl !Sync for DogeError
impl Freeze for DogeError
impl RefUnwindSafe for DogeError
impl Unpin for DogeError
impl UnsafeUnpin for DogeError
impl UnwindSafe for DogeError
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