Skip to main content

Crate natdb_sys

Crate natdb_sys 

Source
Expand description

Raw FFI bindings to LMDB, compiled from the vendored upstream sources in lmdb/ (provenance in lmdb/VENDORED.md).

The declarations in bindings.rs are generated by bindgen from lmdb/lmdb.h and committed, so building this crate does not need libclang. Enable the bindgen feature to regenerate them after updating the vendored sources. For a safe API, use the natdb crate.

Structs§

MDB_crypto_funcs
@brief A structure for dynamically loaded crypto modules.
MDB_cursor
@brief Opaque structure for navigating through a database
MDB_env
@brief Opaque structure for a database environment.
MDB_envinfo
@brief Information about the environment
MDB_stat
@brief Statistics for a database in the environment
MDB_txn
@brief Opaque structure for a transaction handle.
MDB_val
@brief Generic structure used for passing keys and data in and out of the database.

Constants§

MDB_ADDR_BUSY
MDB_APPEND
MDB_APPENDDUP
MDB_BAD_CHECKSUM
MDB_BAD_DBI
MDB_BAD_RSLOT
MDB_BAD_TXN
MDB_BAD_VALSIZE
MDB_CANT_ROLLBACK
MDB_CORRUPTED
MDB_CP_COMPACT
MDB_CREATE
MDB_CRYPTO_FAIL
MDB_CURRENT
MDB_CURSOR_FULL
MDB_DBIS_BUSY
MDB_DBS_FULL
MDB_DUPFIXED
MDB_DUPSORT
MDB_ENCRYPT
MDB_ENV_BUSY
MDB_ENV_ENCRYPTION
MDB_FIRST
< Position at first key/data item
MDB_FIRST_DUP
< Position at first data item of current key. Only for #MDB_DUPSORT
MDB_FIXEDMAP
MDB_GET_BOTH
< Position at key/data pair. Only for #MDB_DUPSORT
MDB_GET_BOTH_RANGE
< position at key, nearest data. Only for #MDB_DUPSORT
MDB_GET_CURRENT
< Return key/data at current cursor position
MDB_GET_MULTIPLE
< Return up to a page of duplicate data items from current cursor position. Move cursor to prepare for #MDB_NEXT_MULTIPLE. Only for #MDB_DUPFIXED
MDB_INCOMPATIBLE
MDB_INTEGERDUP
MDB_INTEGERKEY
MDB_INVALID
MDB_IS_READONLY
MDB_KEYEXIST
MDB_LAST
< Position at last key/data item
MDB_LAST_DUP
< Position at last data item of current key. Only for #MDB_DUPSORT
MDB_LAST_ERRCODE
MDB_MAPASYNC
MDB_MAP_FULL
MDB_MAP_RESIZED
MDB_MULTIPLE
MDB_NEXT
< Position at next data item
MDB_NEXT_DUP
< Position at next data item of current key. Only for #MDB_DUPSORT
MDB_NEXT_MULTIPLE
< Return up to a page of duplicate data items from next cursor position. Move cursor to prepare for #MDB_NEXT_MULTIPLE. Only for #MDB_DUPFIXED
MDB_NEXT_NODUP
< Position at first data item of next key
MDB_NODUPDATA
MDB_NOLOCK
MDB_NOMEMINIT
MDB_NOMETASYNC
MDB_NOOVERWRITE
MDB_NORDAHEAD
MDB_NOSUBDIR
MDB_NOSYNC
MDB_NOTFOUND
MDB_NOTLS
MDB_PAGE_FULL
MDB_PAGE_NOTFOUND
MDB_PANIC
MDB_PREV
< Position at previous data item
MDB_PREVSNAPSHOT
MDB_PREV_DUP
< Position at previous data item of current key. Only for #MDB_DUPSORT
MDB_PREV_MULTIPLE
< Position at previous page and return up to a page of duplicate data items. Only for #MDB_DUPFIXED
MDB_PREV_NODUP
< Position at last data item of previous key
MDB_PROBLEM
MDB_RDONLY
MDB_READERS_FULL
MDB_REMAP_CHUNKS
MDB_RESERVE
MDB_REVERSEDUP
MDB_REVERSEKEY
MDB_RPAGE_CACHE
MDB_SET
< Position at specified key
MDB_SET_KEY
< Position at specified key, return key + data
MDB_SET_RANGE
< Position at first key greater than or equal to specified key.
MDB_SHORT_WRITE
MDB_SUCCESS
MDB_TLS_FULL
MDB_TXN_FULL
MDB_TXN_PENDING
MDB_VERSION_DATE
MDB_VERSION_MAJOR
MDB_VERSION_MINOR
MDB_VERSION_MISMATCH
MDB_VERSION_PATCH
MDB_WRITEMAP

Functions§

mdb_cmp⚠
@brief Compare two data items according to a particular database.
mdb_cursor_close⚠
@brief Close a cursor handle.
mdb_cursor_count⚠
@brief Return count of duplicates for current key.
mdb_cursor_dbi⚠
@brief Return the cursor’s database handle.
mdb_cursor_del⚠
@brief Delete current key/data pair
mdb_cursor_get⚠
@brief Retrieve by cursor.
mdb_cursor_is_db⚠
@brief Check if the cursor is pointing to a named database record.
mdb_cursor_open⚠
@brief Create a cursor handle.
mdb_cursor_put⚠
@brief Store by cursor.
mdb_cursor_renew⚠
@brief Renew a cursor handle.
mdb_cursor_txn⚠
@brief Return the cursor’s transaction handle.
mdb_dbi_close⚠
@brief Close a database handle. Normally unnecessary. Use with care:
mdb_dbi_flags⚠
@brief Retrieve the DB flags for a database handle.
mdb_dbi_open⚠
@brief Open a database in the environment.
mdb_dcmp⚠
@brief Compare two data items according to a particular database.
mdb_del⚠
@brief Delete items from a database.
mdb_drop⚠
@brief Empty or delete+close a database.
mdb_env_close⚠
@brief Close the environment and release the memory map.
mdb_env_copy⚠
@brief Copy an LMDB environment to the specified path.
mdb_env_copy2⚠
@brief Copy an LMDB environment to the specified path, with options.
mdb_env_copyfd⚠
@brief Copy an LMDB environment to the specified file descriptor.
mdb_env_copyfd2⚠
@brief Copy an LMDB environment to the specified file descriptor, with options.
mdb_env_create⚠
@brief Create an LMDB environment handle.
mdb_env_get_fd⚠
@brief Return the filedescriptor for the given environment.
mdb_env_get_flags⚠
@brief Get environment flags.
mdb_env_get_maxkeysize⚠
@brief Get the maximum size of keys and #MDB_DUPSORT data we can write.
mdb_env_get_maxreaders⚠
@brief Get the maximum number of threads/reader slots for the environment.
mdb_env_get_path⚠
@brief Return the path that was used in #mdb_env_open().
mdb_env_get_userctx⚠
@brief Get the application information associated with the #MDB_env.
mdb_env_incr_dump⚠
@brief Perform incremental dump of an LMDB environment to the specified file.
mdb_env_incr_dumpfd⚠
@brief Perform incremental dump of an LMDB environment to the specified file descriptor.
mdb_env_incr_loadfd⚠
@brief Reload an incremental dump of an LMDB environment from the specified file descriptor.
mdb_env_info⚠
@brief Return information about the LMDB environment.
mdb_env_open⚠
@brief Open an environment handle.
mdb_env_rollback⚠
@brief Rollback the last committed transaction in the environment.
mdb_env_set_assert⚠
Set or reset the assert() callback of the environment. Disabled if liblmdb is built with NDEBUG. @note This hack should become obsolete as lmdb’s error handling matures. @param[in] env An environment handle returned by #mdb_env_create(). @param[in] func An #MDB_assert_func function, or 0. @return A non-zero error value on failure and 0 on success.
mdb_env_set_checksum⚠
@brief Set checksums on an environment.
mdb_env_set_encrypt⚠
@brief Set encryption on an environment.
mdb_env_set_flags⚠
@brief Set environment flags.
mdb_env_set_mapsize⚠
@brief Set the size of the memory map to use for this environment.
mdb_env_set_maxdbs⚠
@brief Set the maximum number of named databases for the environment.
mdb_env_set_maxreaders⚠
@brief Set the maximum number of threads/reader slots for the environment.
mdb_env_set_pagesize⚠
@brief Set the size of DB pages in bytes.
mdb_env_set_userctx⚠
@brief Set application information associated with the #MDB_env.
mdb_env_stat⚠
@brief Return statistics about the LMDB environment.
mdb_env_sync⚠
@brief Flush the data buffers to disk.
mdb_get⚠
@brief Get items from a database.
mdb_put⚠
@brief Store items into a database.
mdb_reader_check⚠
@brief Check for stale entries in the reader lock table.
mdb_reader_list⚠
@brief Dump the entries in the reader lock table.
mdb_set_compare⚠
@brief Set a custom key comparison function for a database.
mdb_set_dupsort⚠
@brief Set a custom data comparison function for a #MDB_DUPSORT database.
mdb_set_relctx⚠
@brief Set a context pointer for a #MDB_FIXEDMAP database’s relocation function.
mdb_set_relfunc⚠
@brief Set a relocation function for a #MDB_FIXEDMAP database.
mdb_stat⚠
@brief Retrieve statistics for a database.
mdb_strerror⚠
@brief Return a string describing a given error code.
mdb_txn_abort⚠
@brief Abandon all the operations of the transaction instead of saving them.
mdb_txn_begin⚠
@brief Create a transaction for use with the environment.
mdb_txn_commit⚠
@brief Commit all the operations of a transaction into the database.
mdb_txn_env⚠
@brief Returns the transaction’s #MDB_env
mdb_txn_flags⚠
@brief Retrieve the transaction’s flags
mdb_txn_id⚠
@brief Return the transaction’s ID.
mdb_txn_prepare⚠
@brief Prepare to commit all the operations of a transaction into the database.
mdb_txn_renew⚠
@brief Renew a non-nested read-only transaction.
mdb_txn_reset⚠
@brief Reset a non-nested read-only transaction.
mdb_version⚠
@brief Return the LMDB library version information.

Type Aliases§

MDB_assert_func
@brief A callback function for most LMDB assert() failures, called before printing the message and aborting.
MDB_cmp_func
@brief A callback function used to compare two keys in a database
MDB_crypto_hooks
@brief The function that returns the #MDB_crypto_funcs structure.
MDB_cursor_op
@brief Cursor Get operations.
MDB_dbi
@brief A handle for an individual database in the DB environment.
MDB_enc_func
@brief A callback function used to encrypt/decrypt pages in the env.
MDB_msg_func
@brief A callback function used to print a message from the library.
MDB_rel_func
@brief A callback function used to relocate a position-dependent data item in a fixed-address database.
MDB_str2key_func
@brief A function for converting a string into an encryption key.
MDB_sum_func
@brief A callback function used to checksum pages in the env.
mdb_filehandle_t
An OS file handle: a file descriptor on Unix (mdb_filehandle_t in lmdb.h).
mdb_mode_t
Unix permissions for creating files (mdb_mode_t in lmdb.h).
mdb_size_t
Unsigned type used for mapsize, entry counts and page/transaction IDs.