Enum glommio::GlommioError
source · 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>),
CanNotBeClosed(ResourceType<T>, &'static str),
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(Error)
IO error from standard library functions or libraries that produce std::io::Error’s.
EnhancedIoError
Fields
source: Error
The source error from std::io::Error
.
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::*
.
ExecutorError(ExecutorErrorKind)
Executor error variant(s) for signaling certain error conditions inside the executor.
BuilderError(BuilderErrorKind)
Error variant(s) produced when building executors.
Closed(ResourceType<T>)
The resource in question is closed. Generic because the channel variant needs to return the actual item sent into the channel.
CanNotBeClosed(ResourceType<T>, &'static str)
The resource can not be closed because certain conditions are not satisfied
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