pub enum Error {
Context {
msg: String,
source: Box<SError>,
},
HostLang(Box<dyn HostError>),
Client {
msg: String,
bt: Backtrace,
},
Internal(Error),
}Variants§
Implementations§
Source§impl Error
impl Error
pub fn host(e: impl HostError) -> Self
pub fn client(msg: impl Into<String>) -> Self
pub fn internal(e: impl Into<Error>) -> Self
pub fn internal_msg(msg: impl Into<String>) -> Self
pub fn backtrace(&self) -> Option<&Backtrace>
pub fn without_contexts(&self) -> &Error
pub fn source(&self) -> Option<&(dyn Error + 'static)>
pub fn context<C: Into<String>>(self, context: C) -> Self
pub fn with_context<C: Into<String>, F: FnOnce() -> C>(self, f: F) -> Self
pub fn std_error(self) -> SError
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn StdError + 'static)>
fn source(&self) -> Option<&(dyn StdError + '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()
Source§impl From<FromUtf8Error> for Error
impl From<FromUtf8Error> for Error
Source§fn from(e: FromUtf8Error) -> Self
fn from(e: FromUtf8Error) -> Self
Converts to this type from the input type.
Source§impl From<ParseBoolError> for Error
impl From<ParseBoolError> for Error
Source§fn from(e: ParseBoolError) -> Self
fn from(e: ParseBoolError) -> Self
Converts to this type from the input type.
Source§impl From<ParseIntError> for Error
impl From<ParseIntError> for Error
Source§fn from(e: ParseIntError) -> Self
fn from(e: ParseIntError) -> Self
Converts to this type from the input type.
Source§impl<T> From<PoisonError<T>> for Error
impl<T> From<PoisonError<T>> for Error
Source§fn from(e: PoisonError<T>) -> Self
fn from(e: PoisonError<T>) -> Self
Converts to this type from the input type.
Source§impl From<ResidualError> for Error
impl From<ResidualError> for Error
Source§fn from(e: ResidualError) -> Self
fn from(e: ResidualError) -> Self
Converts to this type from the input type.
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