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
IO error from standard library functions or libraries that produce std::io::Error’s.
Tuple Fields of IoError
0: 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::*
.
Fields of EnhancedIoError
Executor error variant(s) for signaling certain error conditions inside of the executor.
Tuple Fields of ExecutorError
Error variant(s) produced when building executors.
Tuple Fields of BuilderError
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>
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>
Reactor error variants. This includes errors specific to the operation of the io-uring instances or related.
Tuple Fields of ReactorError
Timeout variant used for reporting timed out operations
Tuple Fields of TimedOut
0: Duration
Implementations
Trait Implementations
Performs the conversion.