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 Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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