Struct error_code::ErrorCode
source · pub struct ErrorCode { /* private fields */ }
Expand description
Describes error code of particular category.
Implementations§
source§impl ErrorCode
impl ErrorCode
sourcepub const fn new(code: c_int, category: &'static Category) -> Self
pub const fn new(code: c_int, category: &'static Category) -> Self
Initializes error code with provided category
sourcepub fn new_system(code: c_int) -> Self
pub fn new_system(code: c_int) -> Self
Creates new System error code.
sourcepub fn last_posix() -> Self
pub fn last_posix() -> Self
Gets last POSIX error
sourcepub fn last_system() -> Self
pub fn last_system() -> Self
Gets last System error
sourcepub fn is_would_block(&self) -> bool
pub fn is_would_block(&self) -> bool
Returns true
if underlying error indicates operation can or should be re-tried at later date.
Trait Implementations§
source§impl Error for ErrorCode
impl Error for ErrorCode
1.30.0 · 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()
impl Copy for ErrorCode
impl Eq 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 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)