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§
impl Copy for Error
impl Eq for Error
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
use the Display impl or to_string()