pub enum MdbError {
Show 22 variants
KeyExist,
NotFound,
PageNotFound,
Corrupted,
Panic,
VersionMismatch,
Invalid,
MapFull,
DbsFull,
ReadersFull,
TlsFull,
TxnFull,
CursorFull,
PageFull,
MapResized,
Incompatible,
BadRslot,
BadTxn,
BadValSize,
BadDbi,
Problem,
Other(c_int),
}
Expand description
An LMDB error kind.
Variants§
KeyExist
A key/data pair already exists.
May be also returned by append functions. Data passed doesn’t respect the database ordering.
NotFound
A key/data pair was not found (EOF).
PageNotFound
Requested page not found - this usually indicates corruption.
Corrupted
Located page was wrong type.
Panic
Update of meta page failed or environment had fatal error.
VersionMismatch
Environment version mismatch.
Invalid
File is not a valid LMDB file.
MapFull
Environment mapsize reached.
DbsFull
Environment maxdbs reached.
ReadersFull
Environment maxreaders reached.
TlsFull
Too many TLS keys in use - Windows only.
TxnFull
Txn has too many dirty pages.
CursorFull
Cursor stack too deep - internal error.
PageFull
Page has not enough space - internal error.
MapResized
Database contents grew beyond environment mapsize.
Incompatible
Operation and DB incompatible, or DB type changed. This can mean:
- The operation expects an MDB_DUPSORT / MDB_DUPFIXED database.
- Opening a named DB when the unnamed DB has MDB_DUPSORT / MDB_INTEGERKEY.
- Accessing a data record as a database, or vice versa.
- The database was dropped and recreated with different flags.
BadRslot
Invalid reuse of reader locktable slot.
BadTxn
Transaction cannot recover - it must be aborted.
BadValSize
Unsupported size of key/DB name/data, or wrong DUP_FIXED size.
Common causes of this error:
- You tried to store a zero-length key
- You tried to store a key longer than the max allowed key (511 bytes by default)
- You are using DUP_SORT and trying to store a value longer than the max allowed key size (511 bytes by default)
In the last two cases you can enable the longer-keys
feature to increase the max allowed key size.
BadDbi
The specified DBI was changed unexpectedly.
Problem
Unexpected problem - transaction should abort.
Other(c_int)
Other error.
Implementations§
Source§impl Error
impl Error
Sourcepub fn not_found(&self) -> bool
pub fn not_found(&self) -> bool
Returns true
if the given error is Error::NotFound
.
Sourcepub fn from_err_code(err_code: c_int) -> Error
pub fn from_err_code(err_code: c_int) -> Error
Converts a raw error code to an Error
.
Sourcepub fn to_err_code(&self) -> c_int
pub fn to_err_code(&self) -> c_int
Converts an Error
to the raw error code.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
1.30.0 · 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 Copy for Error
impl Eq for Error
impl StructuralPartialEq 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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 8 bytes
Size for each variant:
KeyExist
: 0 bytesNotFound
: 0 bytesPageNotFound
: 0 bytesCorrupted
: 0 bytesPanic
: 0 bytesVersionMismatch
: 0 bytesInvalid
: 0 bytesMapFull
: 0 bytesDbsFull
: 0 bytesReadersFull
: 0 bytesTlsFull
: 0 bytesTxnFull
: 0 bytesCursorFull
: 0 bytesPageFull
: 0 bytesMapResized
: 0 bytesIncompatible
: 0 bytesBadRslot
: 0 bytesBadTxn
: 0 bytesBadValSize
: 0 bytesBadDbi
: 0 bytesProblem
: 0 bytesOther
: 4 bytes