exposed enum ErrorKind {
// ENOENT: no such file or directory.
NotFound,
// EACCES or EPERM.
PermissionDenied,
// EEXIST.
AlreadyExists,
// EISDIR: a directory where a file was wanted.
IsADirectory,
// ENOTDIR: a file where a directory was wanted, in a path.
NotADirectory,
// ENOTEMPTY: removing a directory that holds something.
DirectoryNotEmpty,
// EINVAL: an argument the call does not take, such as a path holding a NUL.
InvalidInput,
// EPIPE: writing to a pipe nothing reads any more.
BrokenPipe,
// EINTR: a signal interrupted the call.
Interrupted,
// EAGAIN or EWOULDBLOCK: the call would have had to wait.
WouldBlock,
// ETIMEDOUT.
TimedOut,
// EBUSY: in use, such as standard input held by an `Input!`.
Busy,
// ENOSPC: no space left on the device.
StorageFull,
// ENOMEM.
OutOfMemory,
// ENOSYS or ENOTSUP: the host does not do it.
Unsupported,
// Any other errno.
Other,
}
What kind of failure an Error is, for code that handles some kinds: the errnos a portable program tells apart, whatever their numbers on the host. Other is every other errno; errno still tells them apart.