Enum savefile::SavefileError[][src]

#[must_use]
#[non_exhaustive]
pub enum SavefileError {
    IncompatibleSchema {
        message: String,
    },
    IOError {
        io_error: Error,
    },
    InvalidUtf8 {
        msg: String,
    },
    MemoryAllocationLayoutError,
    ArrayvecCapacityError {
        msg: String,
    },
    ShortRead,
    CryptographyError,
    SizeOverflow,
    WrongVersion {
        msg: String,
    },
    GeneralError {
        msg: String,
    },
    PoisonedMutex,
}
Expand description

This object represents an error in deserializing or serializing an item.

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.
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.

Show fields

Fields of IncompatibleSchema

message: String

A short description of the incompatibility

IOError

Some sort of IO failure. Permissions, broken media etc …

Show fields

Fields of IOError

io_error: Error

Cause

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.

Show fields

Fields of InvalidUtf8

msg: String

descriptive message

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.

Show fields

Fields of ArrayvecCapacityError

msg: String

Descriptive message

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

Show fields

Fields of WrongVersion

msg: String

Descriptive message

GeneralError

The file does not have a supported version number

Show fields

Fields of GeneralError

msg: String

Descriptive message

PoisonedMutex

A poisoned mutex was encountered when traversing the object being saved

Trait Implementations

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

The lower-level source of this error, if any. Read more

🔬 This is a nightly-only experimental API. (backtrace)

Returns a stack backtrace, if available, of where this error occurred. Read more

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.