mmtkvdb
mmtkvdb is a crate for Rust which provides a memory-mapped key-value
database. It uses LMDB and links with an existing liblmdb on the system.
Safety
Because of how memory-mapped I/O is being used and also because of certain
assumptions of the underlying LMDB API, opening environments and databases
requires unsafe Rust (i.e. the programmer must ensure that certain
preconditions are met that cannot be enforced by the compiler to avoid
undefined behavior). If you aim to program in safe Rust only, this Rust
library is not suitable for you.
API Documentation
For documentation on how to use this crate, refer to the example in
src/lib.rs.
License
See contained LICENSE file (MIT License).
Changelog
- 2022-05-08: Version 0.1.0
- Removed
'staticbound fromStorabletrait - Improved documentation regarding required
unsafeuse of this library
- Removed
- 2022-05-05: Version 0.0.7
- Fixed method
cursor_set_key_search_value_get_value, which was wrongly defined and documented - Added test function with various tests for cursors
- Fixed method
- 2022-05-01: Version 0.0.6
- Fixed build error on nightly Rust by importing
core::ffi::{c_size_t, c_int, c_uint}for now instead of usingstd::ffi(see commit07ea143f96in Rust for explanation)
- Fixed build error on nightly Rust by importing
- 2022-04-30: Version 0.0.5
- Method
EnvRo::txnmoved toEnvtrait and renamed toEnv::txn_ro. - Method
EnvRw::txnrenamed toEnvRw::txn_rw. - Improved documentation of
EnvRoandEnvRw(doc comment explains how to create them now, i.e. how to start a transaction)
- Method
- 2022-04-22: Version 0.0.4
- No longer use
PhantomDatato store unit-like structs which indicate constraints on key uniqueness inDbOptionsandDb(KeysUniqueandKeysDuplicateareCopynow and contained directly) - Minor fixes in documentation
- Changed argument name for passing
DbOptionstoEnv::open_dbs - Added link to
Sizedin doc comment on private traitIsType
- Changed argument name for passing
- No longer use
- 2022-04-16: Version 0.0.3
- Avoid transmute on references: To avoid issues with (possible) future
changes in Rust, the
storablemodule doesn't usetransmuteon references anymore. Instead,std::slice::from_raw_parts,std::str::from_utf8_unchecked, andstr::as_bytes()are used.
- Avoid transmute on references: To avoid issues with (possible) future
changes in Rust, the
- 2022-04-11: Version 0.0.2
- Moved
Storable,StorableConstBytesLen, andStorableWithOwnedtraits to new (public)storablemodule (butStorablegets re-exported by crate-level module) - Added method to clear stale readers
- Improved documentation on (un)safety
- Avoid unnecessary re-alignment in some cases of
u8andi8 - Make type
boolstorable (i.e. implementStorableforbool) - Added documentation comments for private items
- Code cleanup (moved private
IsTypetrait tohelpersmodule)
- Moved
- 2022-04-10: Version 0.0.1
- First release