mmtkvdb 0.9.0

Memory-mapped key-value database using LMDB
Documentation
# Full changelog of `mmtkvdb`

* 2023-01-10: Version 0.9.0
    * Renamed `DbOptions` to `DbBuilder`
    * Provide type alias `DbSpec<K, V, C>` for `DbBuilder`s which have a name
      (or the unnamed database) set
    * Use `bindgen` version 0.63 for building
* 2022-07-22: Version 0.8.1
    * Fix warning by removing `#![feature(core_ffi_c)]`, which is now stable
    * Removed unnecessary `Sized` supertrait of `Storable`
    * Some code cleanup (simplified bounds on GATs in `Storable` tuples)
* 2022-07-12: Version 0.8.0
    * Trait `Ord` is no longer required for `Storable` types.
    * Use `deref_owned` version 0.10.1
    * Improved documentation
    * Bugfixes
        * The constant `Storable::TRIVIAL_CMP` was set to true for signed byte
          slices, which led to wrong comparisons of keys or duplicate values.
        * The macro `impl_ord_for_storable` was broken. The macro is no longer
          needed and has been removed, thus the bug does not exist anymore.
    * Changed re-exports
        * A new module `cow` has been added, which re-exports items from crate
          `deref_owned`.
        * All relevant items are now re-exported by the crate-level module as
          well.
    * Code cleanup
        * Internal macros in `storable` module have been cleaned up.
        * Cleaner implementation for `BorrowStorable` which allowed removing
          the private `IsType` trait and the public `StorableWithOwned` trait.
        * Consistent use of `GenericCow` where applicable
    * Added more tests
* 2022-07-02: Version 0.7.0
    * Use `deref_owned` version 0.8.0
* 2022-07-01: Version 0.6.0
    * Use `deref_owned` version 0.7.0 (this changes bounds on
      `Storable::AlignedRef`)
* 2022-07-01: Version 0.5.0
    * Use `deref_owned` version 0.6.1
    * `deref_owned::GenericCow` and `deref_owned::Owned` are no longer
      re-exported
* 2022-06-30: Version 0.4.1
    * Use `deref_owned` version 0.4.0
* 2022-06-29: Version 0.4.0
    * Use crate [`deref_owned`]https://crates.io/crates/deref_owned instead
      of own module `owning_pointer`
        * Use `deref_owned::Owned` instead of `owning_pointer::Owned`
        * Use `deref_owned::IntoOwned` instead of
          `owning_pointer::PointerIntoOwned`
        * Use `Vec<T>` instead of `owning_pointer::OwnedPointer<Vec<T>>`
          (as `deref_owned::IntoOwned` is implemented for `Vec<T>`)
        * Re-export `deref_owned::{Owned, IntoOwned}` in module `storable`
        * Re-export `deref_owned::IntoOwned` in crate-level module
    * Provide macro `impl_ord_for_storable`, which allows automatic
      implementation of `PartialEq`, `Eq`, `PartialOrd`, and `Ord` for types
      which implement `Storable`
    * Set `Storable::TRIVIAL_CMP` to true in more cases to improve performance
      and make default implementation of `Storable::cmp_bytes_unchecked` do a
      trivial comparison if constant is true
    * Better documentation/explanation of GAT `storable::Storable::AlignedRef`
* 2022-06-20: Version 0.3.1
    * Accept `StorableRef` instead of references to `Storable` in more places
        * Allow passing `StorableRef` instead of reference to `Storable` as key
          to method `Txn::get_owned` (which was already allowed for `Txn::get`)
        * More generic implementation of `StorableRef` for tuples (e.g.
          `(&i32, &String)` in addition to `(&i32, &str)`), which enhances
          usability in some cases
* 2022-05-26: Version 0.3.0
    * Storing owned types differently
        * Removed implementation of `Storable` for certain smart pointers such
          as `Vec<u8>` and `String`
        * New traits `BorrowStorable` and `StorableRef` which handle storing
          tuples in a more efficient way (without unnecessary cloning/copying)
    * Improved documentation in module `storable`
    * Minor style change: Renamed type arg from `X` to `T` for generic structs
      in `owning_pointer`
* 2022-05-15: Version 0.2.0
    * Trait `Env` was removed. Instead, `EnvRw` implements
      `Deref<Target=EnvRo>`, which makes all methods of `EnvRo` available on
      `EnvRw` as well. Converting an `EnvRw` into `EnvRo` is now simply done by
      cloning.
    * Methods `TxnRw::cursor_delete_current` and
      `TxnRw::cursor_delete_current_key` did not properly defer closing the
      affected databases. This might have caused database corruption when the
      cursor and (all clones of) the database handle are dropped before the
      transaction commits or aborts. This has been fixed.
    * Added support for nested transactions.
    * Suppress warnings regarding unused macro rules when using
      `rustc 1.62.0-nightly (77652b9ef 2022-05-06)` (the unused macro rules are
      kept for potential future use).
    * Improved documentation:
        * The doc comment for `TxnRw` contained a misleading (partial)
          paragraph which was removed.
        * Improved doc comments regarding duplicate keys on methods
          `DbOptions::keys_unique`, `DbOptions::keys_duplicate`,
          `DbOptions::has_duplicate_keys`, `TxnRw::put`,
          `TxnRw::put_unless_key_exists`, `TxnRw::put_unless_pair_exists`.
        * The private doc comment on `DbBackend` has been extended to explain
          the mechanism of `TxnRw::used_dbs`, which defers closing of
          databases.
    * Internal changes:
        * Method `TxnBackend::close_cursors` will finish closing the cursor
          before releasing the lock on the `CursorBackend::closed` flag (this
          should not affect runtime behavior).
        * `EnvRo` is now used in some places where `EnvBackend` has been used
          internally (this allows implementing `Deref<Target=EnvRo>` for
          `EnvRw`).
* 2022-05-08: Version 0.1.0
    * Removed `'static` bound from `Storable` trait
    * Improved documentation regarding required `unsafe` use of this library
* 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
* 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 using
      `std::ffi` (see
      [commit `07ea143f96` in Rust]https://github.com/rust-lang/rust/commit/07ea143f96929ac7f0b7af0f025be48a472273e5
      for explanation)
* 2022-04-30: Version 0.0.5
    * Method `EnvRo::txn` moved to `Env` trait and renamed to `Env::txn_ro`.
    * Method `EnvRw::txn` renamed to `EnvRw::txn_rw`.
    * Improved documentation of `EnvRo` and `EnvRw` (doc comment explains how
      to create them now, i.e. how to start a transaction)
* 2022-04-22: Version 0.0.4
    * No longer use `PhantomData` to store unit-like structs which indicate
      constraints on key uniqueness in `DbOptions` and `Db` (`KeysUnique` and
      `KeysDuplicate` are `Copy` now and contained directly)
    * Minor fixes in documentation
        * Changed argument name for passing `DbOptions` to `Env::open_dbs`
        * Added link to `Sized` in doc comment on private trait `IsType`
* 2022-04-16: Version 0.0.3
    * Avoid transmute on references: To avoid issues with (possible) future
      changes in Rust, the `storable` module doesn't use `transmute` on
      references anymore. Instead, `std::slice::from_raw_parts`,
      `std::str::from_utf8_unchecked`, and `str::as_bytes()` are used.
* 2022-04-11: Version 0.0.2
    * Moved `Storable`, `StorableConstBytesLen`, and `StorableWithOwned` traits
      to new (public) `storable` module (but `Storable` gets 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 `u8` and `i8`
    * Make type `bool` storable (i.e. implement `Storable` for `bool`)
    * Added documentation comments for private items
    * Code cleanup (moved private `IsType` trait to `helpers` module)
* 2022-04-10: Version 0.0.1
    * First release