pub struct NetError { /* private fields */ }Expand description
An error classification, safe context, and an optional shared original cause.
Formatting never includes arbitrary source text. Inspect source() explicitly
when the original third-party or application details are required.
Implementations§
Source§impl NetError
impl NetError
Sourcepub fn from_http_status(status: StatusCode) -> Self
pub fn from_http_status(status: StatusCode) -> Self
Creates an error classified from an HTTP status returned by a protocol or upgrade operation.
Sourcepub fn context(&self) -> &ErrorContext
pub fn context(&self) -> &ErrorContext
Returns structured context captured while processing the failure.
Sourcepub fn http_status(&self) -> Option<StatusCode>
pub fn http_status(&self) -> Option<StatusCode>
Returns the HTTP status associated with the failure, if one was recorded.
Sourcepub fn config_error(&self) -> Option<&ConfigError>
pub fn config_error(&self) -> Option<&ConfigError>
Returns structured configuration details, if the failure came from invalid input.
Sourcepub fn io_kind(&self) -> Option<ErrorKind>
pub fn io_kind(&self) -> Option<ErrorKind>
The first retained I/O category in the source chain, if available.
Trait Implementations§
Source§impl Error for NetError
impl Error for NetError
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<ConfigError> for NetError
impl From<ConfigError> for NetError
Source§fn from(value: ConfigError) -> Self
fn from(value: ConfigError) -> Self
Converts to this type from the input type.
Source§impl<T> From<EnqueueError<T>> for NetError
impl<T> From<EnqueueError<T>> for NetError
Source§fn from(value: EnqueueError<T>) -> Self
fn from(value: EnqueueError<T>) -> Self
Converts to this type from the input type.
Source§impl From<ReceiveError> for NetError
impl From<ReceiveError> for NetError
Source§fn from(value: ReceiveError) -> Self
fn from(value: ReceiveError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for NetError
impl !UnwindSafe for NetError
impl Freeze for NetError
impl Send for NetError
impl Sync for NetError
impl Unpin for NetError
impl UnsafeUnpin for NetError
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