Enum Error

Source
pub enum Error {
Show 22 variants DatabaseNotOpen, DatabaseOpen, InvalidDatabase(bool), InvalidMapping, VersionMismatch, ChecksumMismatch, FileSizeTooSmall(u64), Timeout, FreePagesNotLoaded, BucketNotFound, BucketExists, BucketNameRequired, KeyRequired, KeyTooLarge, ValueTooLarge, IncompatibleValue, MMapTooSmall(u64), MMapTooLarge, TrySolo, BatchDisabled, IO(Error), Other(Error),
}
Expand description

Bolt database errors

Variants§

§

DatabaseNotOpen

DatabaseNotOpen is returned when a DB instance is accessed before it is opened or after it is closed.

§

DatabaseOpen

DatabaseOpen is returned when opening a database that is already open.

§

InvalidDatabase(bool)

InvalidDatabase is returned when both meta pages on a database are invalid. This typically occurs when a file is not a bolt database.

§

InvalidMapping

InvalidMapping is returned when the database file fails to get mapped.

§

VersionMismatch

ErrVersionMismatch is returned when the data file was created with a different version of Bolt.

§

ChecksumMismatch

Checksum is returned when either meta page checksum does not match.

§

FileSizeTooSmall(u64)

File size is below the minimum size a Bolt database could be

§

Timeout

Timeout is returned when a database cannot obtain an exclusive lock on the data file after the timeout passed to Open().

§

FreePagesNotLoaded

FreePagesNotLoaded is returned when a readonly transaction without preloading the free pages is trying to access the free pages.

§

BucketNotFound

BucketNotFound is returned when trying to access a bucket that has not been created yet.

§

BucketExists

BucketExists is returned when creating a bucket that already exists.

§

BucketNameRequired

BucketNameRequired is returned when creating a bucket with a blank name.

§

KeyRequired

KeyRequired is returned when inserting a zero-length key.

§

KeyTooLarge

KeyTooLarge is returned when inserting a key that is larger than MaxKeySize.

§

ValueTooLarge

ValueTooLarge is returned when inserting a value that is larger than MaxValueSize.

§

IncompatibleValue

IncompatibleValue is returned when trying to create or delete a bucket on an existing non-bucket key or when trying to create or delete a non-bucket key on an existing bucket key.

§

MMapTooSmall(u64)

File size is below the minimum size a Bolt database could be

§

MMapTooLarge

File size is larger than the maximum size a Bolt database could be

§

TrySolo

Batch call failed. Try again without batch

§

BatchDisabled

Batch is disabled

§

IO(Error)

Chained errors from other sources

§

Other(Error)

User defined error

Trait Implementations§

Source§

impl Debug for Error

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Error

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for Error

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for Error

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for Error

Auto Trait Implementations§

§

impl Freeze for Error

§

impl !RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl !UnwindSafe for Error

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.