Enum savefile::SavefileError
source · #[non_exhaustive]pub enum SavefileError {
Show 13 variants
IncompatibleSchema {
message: String,
},
IOError {
io_error: Error,
},
InvalidUtf8 {
msg: String,
},
MemoryAllocationLayoutError,
ArrayvecCapacityError {
msg: String,
},
ShortRead,
CryptographyError,
SizeOverflow,
WrongVersion {
msg: String,
},
GeneralError {
msg: String,
},
PoisonedMutex,
CompressionSupportNotCompiledIn,
InvalidChar,
}
Expand description
This object represents an error in deserializing or serializing an item.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
IncompatibleSchema
Error given when the schema stored in a file, does not match the schema given by the data structures in the code, taking into account versions.
IOError
Some sort of IO failure. Permissions, broken media etc …
InvalidUtf8
The binary data which is being deserialized, contained an invalid utf8 sequence where a String was expected. If this occurs, it is either a bug in savefile, a bug in an implementation of Deserialize, Serialize or WithSchema, or a corrupt data file.
MemoryAllocationLayoutError
Unexpected error with regards to memory layout requirements.
ArrayvecCapacityError
An Arrayvec had smaller capacity than the size of the data in the binary file.
ShortRead
The reader returned fewer bytes than expected
CryptographyError
Cryptographic checksum mismatch. Probably due to a corrupt file.
SizeOverflow
A persisted value of isize or usize was greater than the maximum for the machine. This can happen if a file saved by a 64-bit machine contains an usize or isize which does not fit in a 32 bit word.
WrongVersion
The file does not have a supported version number
GeneralError
The file does not have a supported version number
PoisonedMutex
A poisoned mutex was encountered when traversing the object being saved
CompressionSupportNotCompiledIn
File was compressed, or user asked for compression, but bzip2-library feature was not enabled.
InvalidChar
Invalid char, i.e, a serialized value expected to be a char was encountered, but it had an invalid value.