enum ErrorKind {
Adhoc(AdhocError),
Range(RangeError),
Shared(Error),
FilePath(FilePathError),
IO(IOError),
}Expand description
The underlying kind of a Error.
Variants§
Adhoc(AdhocError)
An ad hoc error that is constructed from anything that implements
the core::fmt::Display trait.
In theory we try to avoid these, but they tend to be awfully convenient. In practice, we use them a lot, and only use a structured representation when a lot of different error cases fit neatly into a structure (like range errors).
Range(RangeError)
An error that occurs when a number is not within its allowed range.
This can occur directly as a result of a number provided by the caller of a public API, or as a result of an operation on a number that results in it being out of range.
An error that occurs within jiff::shared.
It has its own error type to avoid bringing in this much bigger error type.
FilePath(FilePathError)
An error associated with a file path.
This is generally expected to always have a cause attached to it explaining what went wrong. The error variant is just a path to make it composable with other error types.
The cause is typically Adhoc or IO.
When std is not enabled, this variant can never be constructed.
IO(IOError)
An error that occurs when interacting with the file system.
This is effectively a wrapper around std::io::Error coupled with a
std::path::PathBuf.
When std is not enabled, this variant can never be constructed.