[][src]Enum savefile::SavefileError

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

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

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

Fields of IncompatibleSchema

message: String

A short description of the incompatibility

IOError

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

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.

Fields of InvalidUtf8

msg: String

descriptive message

OutOfMemory

Savefile failed to allocate enough memory. Either you have too little memory, or the file is corrupt somehow.

Fields of OutOfMemory

err: AllocErr

Cause

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.

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

Fields of WrongVersion

msg: String

Descriptive message

GeneralError

The file does not have a supported version number

Fields of GeneralError

msg: String

Descriptive message

Trait Implementations

impl Debug for SavefileError[src]

impl Display for SavefileError[src]

impl Fail for SavefileError[src]

impl From<AllocErr> for SavefileError[src]

impl<T> From<CapacityError<T>> for SavefileError[src]

impl From<Error> for SavefileError[src]

impl From<FromUtf8Error> for SavefileError[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> AsFail for T where
    T: Fail
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Erased for T

impl<E> Fail for E where
    E: 'static + Error + Send + Sync
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,