[][src]Struct error_code::ErrorCode

pub struct ErrorCode<C> { /* fields omitted */ }

Describes error code in particular category.

Implementations

impl ErrorCode<PosixCategory>[src]

pub fn last() -> Self[src]

Retrieves last error, generated by runtime

pub fn is_would_block(self) -> bool[src]

Returns whether underlying error means to try again.

Under POSIX, it means either EWOULDBLOCK or EAGAIN, in some cases it can be the same error code.

impl ErrorCode<SystemCategory>[src]

pub fn last() -> Self[src]

Retrieves last error, generated by OS

pub fn is_would_block(self) -> bool[src]

Returns whether underlying error means to try again.

Under POSIX, it means either EWOULDBLOCK or EAGAIN, in some cases it can be the same error code. In case of Windows, it is also WSAEWOULDBLOCK

impl<C> ErrorCode<C>[src]

pub const fn new(code: i32) -> Self[src]

Creates new error code in provided category.

pub const fn raw_code(self) -> i32[src]

Access raw integer code

pub const fn is_zero(self) -> bool[src]

Returns whether error code is zero.

Commonly zero is indication of no error.

impl<C: Category> ErrorCode<C>[src]

pub fn message(self) -> Str[src]

Returns textual representation of the error code

pub fn into_another<O: Category>(self) -> ErrorCode<O> where
    C: IntoCategory<O>, 
[src]

Converts self into error code of another category.

Requires self's category to implement IntoCategory for destination category.

Trait Implementations

impl<C> Clone for ErrorCode<C>[src]

impl<C> Copy for ErrorCode<C>[src]

impl<C: Category> Debug for ErrorCode<C>[src]

impl<C: Category> Display for ErrorCode<C>[src]

impl<C> Eq for ErrorCode<C>[src]

impl<C> From<i32> for ErrorCode<C>[src]

impl<C> Hash for ErrorCode<C>[src]

impl<C> Ord for ErrorCode<C>[src]

impl<C> PartialEq<ErrorCode<C>> for ErrorCode<C>[src]

impl<C> PartialOrd<ErrorCode<C>> for ErrorCode<C>[src]

impl<C> Send for ErrorCode<C>[src]

impl<C> Sync for ErrorCode<C>[src]

impl<C> Unpin for ErrorCode<C>[src]

Auto Trait Implementations

impl<C> RefUnwindSafe for ErrorCode<C> where
    C: RefUnwindSafe

impl<C> UnwindSafe for ErrorCode<C> where
    C: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.