pub struct Error {
pub kind: ErrorKind,
pub ctx: Option<Cow<'static, str>>,
pub source: Option<Box<dyn Error + Send + Sync>>,
}Fields§
§kind: ErrorKind§ctx: Option<Cow<'static, str>>§source: Option<Box<dyn Error + Send + Sync>>Implementations§
Source§impl Error
impl Error
pub const fn new(kind: ErrorKind) -> Self
pub fn with_ctx(self, ctx: impl Into<Cow<'static, str>>) -> Self
pub fn with_source<E: Into<Box<dyn Error + Send + Sync>>>(self, e: E) -> Self
pub fn io(msg: impl Into<Cow<'static, str>>) -> Self
pub fn protocol(msg: impl Into<Cow<'static, str>>) -> Self
pub const fn upstream(reason: UpstreamReason) -> Self
pub fn middleware(msg: impl Into<Cow<'static, str>>) -> Self
pub fn compile(msg: impl Into<Cow<'static, str>>) -> Self
pub const fn timeout(kind: TimeoutKind) -> Self
pub const fn canceled() -> Self
pub const fn resource(kind: ResourceKind) -> Self
pub fn internal(msg: impl Into<Cow<'static, str>>) -> Self
pub const fn kind(&self) -> &ErrorKind
pub fn ctx(&self) -> Option<&str>
pub const fn kind_label(&self) -> &'static str
pub const fn reason_label(&self) -> Option<&'static str>
pub const fn is_retryable(&self) -> bool
pub const fn http_status(&self) -> u16
pub fn source_chain(&self) -> Vec<String>
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()
Source§impl From<&Error> for SerializedError
impl From<&Error> for SerializedError
Source§impl From<AddrParseError> for Error
impl From<AddrParseError> for Error
Source§fn from(e: AddrParseError) -> Self
fn from(e: AddrParseError) -> 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 UnsafeUnpin 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