pub enum ErrorKind {
Interrupted,
InvalidData,
InvalidInput,
UnexpectedEof,
WriteZero,
Other,
}
Expand description
A list specifying general categories of I/O error.
This list is intended to grow over time and it is not recommended to exhaustively match against it.
It is used with the acid_io::Error
type.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Interrupted
This operation was interrupted.
Interrupted operations can typically be retried.
InvalidData
Data not valid for the operation were encountered.
Unlike InvalidInput
, this typically means that the operation
parameters were valid, however the error was caused by malformed
input data.
For example, a function that reads a file into a string will error with
InvalidData
if the file’s contents are not valid UTF-8.
InvalidInput
A parameter was incorrect.
UnexpectedEof
An error returned when an operation could not be completed because an “end of file” was reached prematurely.
This typically means that an operation could only succeed if it read a particular number of bytes but only a smaller number of bytes could be read.
WriteZero
An error returned when an operation could not be completed because a
call to write
returned Ok(0)
.
This typically means that an operation could only succeed if it wrote a particular number of bytes but only a smaller number of bytes could be written.
Other
A custom error that does not fall under any other I/O error kind.
This can be used to construct your own Error
s that do not match any
ErrorKind
.
This ErrorKind
is not used by acid_io
.
Errors from the standard library that do not fall under any of the I/O
error kinds cannot be match
ed on, and will only match a wildcard (_
)
pattern. New ErrorKind
s might be added in the future for some of
those.
Trait Implementations§
source§impl From<ErrorKind> for Error
impl From<ErrorKind> for Error
Intended for use for errors not exposed to the user, where allocating onto the heap (for normal construction via Error::new) is too costly.