Enum glommio::GlommioError[][src]

pub enum GlommioError<T> {
    IoError(Error),
    EnhancedIoError {
        source: Error,
        op: &'static str,
        path: Option<PathBuf>,
        fd: Option<RawFd>,
    },
    ExecutorError(ExecutorErrorKind),
    Closed(ResourceType<T>),
    WouldBlock(ResourceType<T>),
    ReactorError(ReactorErrorKind),
    TimedOut(Duration),
}

Composite error type to encompass all error types glommio produces.

Single error type that will be produced by any public Glommio API functions. Contains a generic type that is only used for the Channel variants. In other cases it can just be replaced with the unit type () and ignored. The variants are broken up into a few common categories such as Closed and WouldBlock as well as a generic IoError and errors dedicated to the executor and reactor.

Examples

use glommio::{GlommioError, ResourceType};

fn will_error() -> Result<(), GlommioError<()>> {
    Err(GlommioError::WouldBlock(ResourceType::File(
        "Error reading a file".to_string(),
    )))?
}
assert!(will_error().is_err());

Variants

IoError(Error)

IO error from standard library functions or libraries that produce std::io::Error’s.

EnhancedIoError

Enhanced IO error that gives more information in the error message than the basic IoError. It includes the operation, path and file descriptor. It also contains the error from the source IO error from std::io::*.

Show fields

Fields of EnhancedIoError

source: Error

The source error from std::io::Error.

op: &'static str

The operation that was being attempted.

path: Option<PathBuf>

The path of the file, if relavent.

fd: Option<RawFd>

The numeric file descriptor of the relavent resource.

ExecutorError(ExecutorErrorKind)

Executor error variant(s) for signaling certain error conditions inside of the executor.

Closed(ResourceType<T>)

The resource in question is closed. Generic because the channel variant needs to return the actual item sent into the channel.

WouldBlock(ResourceType<T>)

Error encapsulating the WouldBlock error for types that don’t have errors originating in the standard library. Glommio also has nonblocking types that need to indicate if they are blocking or not. This type allows for signaling when a function would otherwise block for a specific ResourceType.

ReactorError(ReactorErrorKind)

Reactor error variants. This includes errors specific to the operation of the io-uring instances or related.

TimedOut(Duration)

Timeout variant used for reporting timed out operations

Implementations

impl<T> GlommioError<T>[src]

pub fn raw_os_error(&self) -> Option<i32>[src]

Returns the OS error that this error represents (if any).

If this Error was constructed from an io::Error which encapsulates a raw OS error, then this function will return Some, otherwise it will return None.

Trait Implementations

impl<T> Display for GlommioError<T>[src]

impl<T> Error for GlommioError<T>[src]

impl<T> From<(Error, ResourceType<T>)> for GlommioError<T>[src]

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

Auto Trait Implementations

impl<T> !RefUnwindSafe for GlommioError<T>

impl<T> Send for GlommioError<T> where
    T: Send

impl<T> Sync for GlommioError<T> where
    T: Sync

impl<T> Unpin for GlommioError<T> where
    T: Unpin

impl<T> !UnwindSafe for GlommioError<T>

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> 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.