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-06-30: Version 0.4.1
- Use
deref_ownedversion 0.4.0
- Use
- 2022-06-29: Version 0.4.0
- Use crate
deref_ownedinstead of own moduleowning_pointer- Use
deref_owned::Ownedinstead ofowning_pointer::Owned - Use
deref_owned::IntoOwnedinstead ofowning_pointer::PointerIntoOwned - Use
Vec<T>instead ofowning_pointer::OwnedPointer<Vec<T>>(asderef_owned::IntoOwnedis implemented forVec<T>) - Re-export
deref_owned::{Owned, IntoOwned}in modulestorable - Re-export
deref_owned::IntoOwnedin crate-level module
- Use
- Provide macro
impl_ord_for_storable, which allows automatic implementation ofPartialEq,Eq,PartialOrd, andOrdfor types which implementStorable - Set
Storable::TRIVIAL_CMPto true in more cases to improve performance and make default implementation ofStorable::cmp_bytes_uncheckeddo a trivial comparison if constant is true - Better documentation/explanation of GAT
storable::Storable::AlignedRef
- Use crate
- 2022-06-20: Version 0.3.1
- Accept
StorableRefinstead of references toStorablein more places- Allow passing
StorableRefinstead of reference toStorableas key to methodTxn::get_owned(which was already allowed forTxn::get) - More generic implementation of
StorableReffor tuples (e.g.(&i32, &String)in addition to(&i32, &str)), which enhances usability in some cases
- Allow passing
- Accept
- 2022-05-26: Version 0.3.0
- Storing owned types differently
- Removed implementation of
Storablefor certain smart pointers such asVec<u8>andString - New traits
BorrowStorableandStorableRefwhich handle storing tuples in a more efficient way (without unnecessary cloning/copying)
- Removed implementation of
- Improved documentation in module
storable - Minor style change: Renamed type arg from
XtoTfor generic structs inowning_pointer
- Storing owned types differently
For older changes, refer to the CHANGELOG.md file.