pub struct ErrorCode(/* private fields */);Expand description
A fault’s code, as the layer that reported it numbers it: its meaning is the IoFault’s
source’s (DI-D-50). The Windows backend’s are HRESULTs, the form the I/O ring reports every
failure in. A Win32 code is wrapped into one, and read back out of one, by win-durable-ioring,
which owns that rule; this type carries the number and does not interpret it.
Carried by every IoFault a layer reports with one, so a consumer reads a
code without that layer’s own error types. The Windows backend’s are read from an io::Error
by win-durable-ioring’s error_code_of.
use durable_ioring::ErrorCode;
// ERROR_IO_DEVICE, wrapped as an HRESULT.
let code = ErrorCode::from_hresult(0x8007_045D_u32.cast_signed());
assert_eq!(code.hresult().cast_unsigned(), 0x8007_045D);
assert_eq!(code.to_string(), "0x8007045D");Implementations§
Trait Implementations§
impl Copy for ErrorCode
impl Eq for ErrorCode
impl StructuralPartialEq for ErrorCode
Auto Trait Implementations§
impl Freeze for ErrorCode
impl RefUnwindSafe for ErrorCode
impl Send for ErrorCode
impl Sync for ErrorCode
impl Unpin for ErrorCode
impl UnsafeUnpin for ErrorCode
impl UnwindSafe for ErrorCode
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