#[non_exhaustive]pub enum OsErrorClass {
Reset,
Aborted,
TimedOut,
Refused,
Unreachable,
FileTruncated,
Other(i32),
}Expand description
The class of an OS error, without its message text.
use net_io::OsErrorClass;
let class = OsErrorClass::from_io(&std::io::Error::from(std::io::ErrorKind::ConnectionReset));
assert_eq!(class, OsErrorClass::Reset);Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Reset
The peer reset the connection.
Aborted
The connection was aborted locally.
TimedOut
The OS timed the connection out (for example failed keepalive probes).
Refused
The connection was refused.
Unreachable
No route.
FileTruncated
A file ended while it was being sent.
Other(i32)
Any other OS error, by number.
Implementations§
Source§impl OsErrorClass
impl OsErrorClass
Sourcepub fn from_io(e: &Error) -> OsErrorClass
pub fn from_io(e: &Error) -> OsErrorClass
Classifies an io::Error.
Trait Implementations§
Source§impl Clone for OsErrorClass
impl Clone for OsErrorClass
impl Copy for OsErrorClass
Source§impl Debug for OsErrorClass
impl Debug for OsErrorClass
impl Eq for OsErrorClass
Source§impl Hash for OsErrorClass
impl Hash for OsErrorClass
Source§impl PartialEq for OsErrorClass
impl PartialEq for OsErrorClass
impl StructuralPartialEq for OsErrorClass
Auto Trait Implementations§
impl Freeze for OsErrorClass
impl RefUnwindSafe for OsErrorClass
impl Send for OsErrorClass
impl Sync for OsErrorClass
impl Unpin for OsErrorClass
impl UnsafeUnpin for OsErrorClass
impl UnwindSafe for OsErrorClass
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