#[non_exhaustive]pub enum LoadError {
Io(Error),
UnexpectedEof {
offset: usize,
needed: usize,
available: usize,
},
UnsupportedVersion(u16),
ChecksumMismatch {
expected: u32,
found: u32,
},
InvalidTypeTag(u8),
SizeMismatch {
expected: usize,
found: usize,
},
InvalidUtf8,
InvalidChar(u32),
ImplausibleLength {
declared: usize,
remaining: usize,
},
LegacyNestedArray,
Table(TableError),
Insert(InsertError),
}Expand description
Something went wrong while reading a database file.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Io(Error)
std only.The file could not be opened or read.
Only produced by Database::load, so it exists
only with the std feature; Database::from_bytes
never returns it.
UnexpectedEof
The file ended in the middle of a value.
Fields
UnsupportedVersion(u16)
The file carries a SafeEn magic number but an unknown format version.
ChecksumMismatch
The stored checksum does not match the payload.
InvalidTypeTag(u8)
A type tag in the file does not correspond to any TypeDefs.
SizeMismatch
A value’s declared byte width does not match its type.
InvalidUtf8
A string field was not valid UTF-8.
InvalidChar(u32)
A char field did not hold a valid Unicode scalar value.
ImplausibleLength
The file declares a length that cannot be satisfied by its remaining bytes.
LegacyNestedArray
A legacy (v1) file used a nested array type, which v1 cannot represent.
Table(TableError)
The file’s table definitions were rejected.
Insert(InsertError)
The file’s row data did not match its own table definitions.
Trait Implementations§
Source§impl Error for LoadError
impl Error for LoadError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()