Enum savefile::SavefileError
source · #[non_exhaustive]pub enum SavefileError {
Show 19 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,
IncompatibleSavefileLibraryVersion,
MissingMethod {
method_name: String,
},
TooManyArguments,
CalleePanic {
msg: String,
},
LoadLibraryFailed {
libname: String,
msg: String,
},
LoadSymbolFailed {
libname: String,
symbol: String,
msg: String,
},
}
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.
IncompatibleSavefileLibraryVersion
This occurs for example when using the stable ABI-functionality to call into a library, and then it turns out that library uses a future, incompatible, Savefile-library version.
MissingMethod
This occurs if a foreign ABI entry point is missing a method
TooManyArguments
Savefile ABI only supports at most 63 arguments per function
CalleePanic
An ABI callee panicked
LoadLibraryFailed
Loading an extern library failed (only relevant for savefile-abi)
LoadSymbolFailed
Loading an extern library failed (only relevant for savefile-abi)
Implementations§
source§impl SavefileError
impl SavefileError
sourcepub fn general(something: impl Display) -> SavefileError
pub fn general(something: impl Display) -> SavefileError
Construct a SavefileError::GeneralError using the given string