Expand embedded_io::ErrorKind to better match std::io::ErrorKind.
embedded_io::ErrorKind only has 18 variants while std::io::ErrorKind has 41. I am porting a zip library to no_std and would like to use more of the variants. Some of these variants would also be useful for filesystems on sdcards. These are some of the errors I need to use. NotADirectory, IsADirectory, DirectoryNotEmpty, ReadOnlyFilesystem, StorageFull, NotSeekable, QuotaExceeded, FileTooLarge, CrossesDevices, InvalidFilename, UnexpectedEof,
I don't see why not implementing all of them though?
I think only some make sense as kinds:
- Those make sense: ReadOnlyFilesystem, StorageFull, NotSeekable, QuotaExceeded, FileTooLarge
- Those apply to operations that are not possible through embedded-io:
- NotADirectory, IsADirectory, DirectoryNotEmpty (for directory operations or file opening)
- CrossesDevices (for moving)
- InvalidFilename (for opening files)
- UnexpectedEof is already present as part of ReadExactError
ResourceBusy and InProgress are not bad either for indicating that the read/write head is unavailable.
ResourceBusy to indicate that either:
- control of the read/write head is owned by someone else
- or that taking control would corrupt the stream state.
InProgress to indicate that either:
- a stream is already undergoing an operation
- or like EINPROGRESS (for socket connections) where the stream state (socket connection) setup is still underway (awaiting connection established).