pub struct Error { /* private fields */ }Expand description
Compiler error
Implementations§
Source§impl Error
impl Error
Sourcepub fn with_msg<S: Into<Cow<'static, str>>>(msg: S) -> Self
pub fn with_msg<S: Into<Cow<'static, str>>>(msg: S) -> Self
Create a new compiler error with the given message
Sourcepub fn context<K, V>(self, key: K, value: V) -> Self
pub fn context<K, V>(self, key: K, value: V) -> Self
Add context to the last traced call.
Example context: Value that parameters from the trace evaluate to.
Sourcepub fn cause<E: ErrorClone>(self, cause: E) -> Self
pub fn cause<E: ErrorClone>(self, cause: E) -> Self
Add an external cause to the error for debugging purposes.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§fn cause(&self) -> Option<&dyn Error>
fn cause(&self) -> Option<&dyn Error>
👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<E> ErrorClone for E
impl<E> ErrorClone for E
Source§fn clone_box(&self) -> Box<dyn ErrorClone>
fn clone_box(&self) -> Box<dyn ErrorClone>
Clone the error.