pub enum DatabaseError {
    ItemNotFound,
    DupeFound,
    SavePathRequired,
    IOError(Error),
    DatabaseNotFound,
    BadDbName,
}
Expand description

An error enum for the possible faliure states of the crate::Database structure.

Variants

ItemNotFound

When the item queried for was not found

DupeFound

A duplicate value was found when adding to the database with crate::Database::strict_dupes allowed.

SavePathRequired

When crate::Database::save_path is required but is not found. This commonly happens when loading or dumping a database with crate::Database::save_path being Option::None.

IOError(Error)

Misc std::io::Error that could not be properly handled.

DatabaseNotFound

When the database could not be found. This is typically raised inside of crate::Database::from when it tries to retrieve the path to the database.

BadDbName

When the given database name to an assumption-making function like crate::Database::auto_from does not have a valid file stem or could not convert from an std::ffi::OsString to a String.

Trait Implementations

Formats the value using the given formatter. Read more

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.