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-29: Version 0.4.0
- Use crate
deref_owned
instead of own moduleowning_pointer
- Use
deref_owned::Owned
instead ofowning_pointer::Owned
- Use
deref_owned::IntoOwned
instead ofowning_pointer::PointerIntoOwned
- Use
Vec<T>
instead ofowning_pointer::OwnedPointer<Vec<T>>
(asderef_owned::IntoOwned
is implemented forVec<T>
) - Re-export
deref_owned::{Owned, IntoOwned}
in modulestorable
- Re-export
deref_owned::IntoOwned
in crate-level module
- Use
- Provide macro
impl_ord_for_storable
, which allows automatic implementation ofPartialEq
,Eq
,PartialOrd
, andOrd
for types which implementStorable
- Set
Storable::TRIVIAL_CMP
to true in more cases to improve performance and make default implementation ofStorable::cmp_bytes_unchecked
do 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
StorableRef
instead of references toStorable
in more places- Allow passing
StorableRef
instead of reference toStorable
as key to methodTxn::get_owned
(which was already allowed forTxn::get
) - More generic implementation of
StorableRef
for 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
Storable
for certain smart pointers such asVec<u8>
andString
- New traits
BorrowStorable
andStorableRef
which 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
X
toT
for generic structs inowning_pointer
- Storing owned types differently
For older changes, refer to the CHANGELOG.md
file.