Enum glommio::GlommioError[][src]

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

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

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

Tuple Fields of IoError

0: Error
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::*.

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

fd: Option<RawFd>

The numeric file descriptor of the relevant resource.

ExecutorError

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

Tuple Fields of ExecutorError

0: ExecutorErrorKind
BuilderError

Error variant(s) produced when building executors.

Tuple Fields of BuilderError

0: BuilderErrorKind
Closed

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

Tuple Fields of Closed

0: ResourceType<T>
WouldBlock

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.

Tuple Fields of WouldBlock

0: ResourceType<T>
ReactorError

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

Tuple Fields of ReactorError

0: ReactorErrorKind
TimedOut

Timeout variant used for reporting timed out operations

Tuple Fields of TimedOut

0: Duration

Implementations

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

Formats the value using the given formatter. Read more

The lower-level source of this error, if any. Read more

🔬 This is a nightly-only experimental API. (backtrace)

Returns a stack backtrace, if available, of where this error occurred. Read more

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Performs the conversion.

Performs the conversion.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Should always be Self

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.