pub enum Error {
FileOpenError(Error),
ReadError,
EndiannessError,
AlignmentError,
MajorVersionMismatch(u16),
MinorVersionMismatch(u16),
UsizeSizeMismatch(usize),
MagicCookieError(u64),
InvalidTag(usize),
WrongTypeHash {
ser_type_name: String,
ser_type_hash: u64,
self_type_name: String,
self_ser_type_name: String,
self_type_hash: u64,
},
WrongAlignHash {
ser_type_name: String,
ser_align_hash: u64,
self_type_name: String,
self_ser_type_name: String,
self_align_hash: u64,
},
}Expand description
Errors that can happen during deserialization.
Variants§
FileOpenError(Error)
Deserialize::load_full could not open the provided file.
ReadError
The underlying reader returned an error.
EndiannessError
The file is from ε-serde but the endianness is wrong.
AlignmentError
Some fields are not properly aligned.
MajorVersionMismatch(u16)
The file was serialized with a version of ε-serde that is not compatible.
MinorVersionMismatch(u16)
The file was serialized with a compatible, but too new version of ε-serde so we might be missing features.
UsizeSizeMismatch(usize)
The pointer width of the serialized file is different from the pointer width of the current architecture. For example, the file was serialized on a 64-bit machine and we are trying to deserialize it on a 32-bit machine.
MagicCookieError(u64)
The magic cookie is wrong. The byte sequence does not come from ε-serde.
InvalidTag(usize)
A tag is wrong (e.g., for Option).
WrongTypeHash
The type hash is wrong. Probably the user is trying to deserialize a file with the wrong type.
Fields
WrongAlignHash
The type representation hash is wrong. Probably the user is trying to deserialize a file with some zero-copy type that has different in-memory representations on the serialization arch and on the current one, usually because of alignment issues. There are also some backward-compatibility issues discussed in the error message.