#[non_exhaustive]pub enum IoError {
Truncated {
needed: usize,
got: usize,
},
UnknownVersion {
got: u8,
},
InvalidBitWidth {
got: u8,
},
InvalidUtf8,
LengthMismatch,
BadMagic {
got: [u8; 4],
},
InvalidHeader,
Decode(CodecError),
Io(Error),
}Expand description
Errors produced by serialization and file I/O operations.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Truncated
The input slice is shorter than expected.
UnknownVersion
The format version byte is not recognized.
InvalidBitWidth
The bit_width field in the serialized data is not in {2, 4, 8}.
InvalidUtf8
The config_hash field contains bytes that are not valid UTF-8.
LengthMismatch
A length in the serialized data does not match the expected value.
BadMagic
The file magic bytes are not TQCV.
InvalidHeader
A header field value is outside its valid range.
Decode(CodecError)
An inner codec operation failed during decode.
Io(Error)
A file system I/O error (used in Phase 17+ file-path APIs).
Trait Implementations§
Source§impl Error for IoError
impl Error for IoError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<CodecError> for IoError
impl From<CodecError> for IoError
Source§fn from(source: CodecError) -> Self
fn from(source: CodecError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for IoError
impl !RefUnwindSafe for IoError
impl Send for IoError
impl Sync for IoError
impl Unpin for IoError
impl UnsafeUnpin for IoError
impl !UnwindSafe for IoError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more