Crate mmdb

Source
Expand description

GitHub top language Rust Latest Version Rust Documentation Minimum rustc version

§mmdb

mmdb is a ‘std-collection-like’ database.

This is a simplified version of vsdb, retaining only the most practical and stable parts.

To view the change log check here.

§Highlights

  • Most APIs is similar as the coresponding data structures in the standard library
    • Use Vecx just like Vec
    • Use Mapx just like HashMap
    • Use MapxOrd just like BTreeMap

§Compilation features

  • [ DEFAULT ] rocks_backend, use rocksdb as the backend database
    • Stable
    • C++ implementation, difficult to be compiled into a static binary
  • parity_backend, use parity-db as the backend database
    • Experimental
    • Pure rust implementation, can be easily compiled into a static binary
  • msgpack_codec, use rmp-serde as the codec
    • Faster running speed than json
  • json_codec, use serde_json as the codec
    • Better generality and compatibility
  • compress, enable compression in the backend database

§NOTE

  • The serialized result of a mmdb instance can not be used as the basis for distributed consensus
    • The serialized result only contains some meta-information(storage paths, etc.)
    • These meta-information are likely to be different in different environments
    • The correct way is to read what you need from it, and then process the real content

Re-exports§

pub use basic::mapx::Mapx;
pub use basic::mapx_ord::MapxOrd;
pub use basic::mapx_ord_rawkey::MapxOrdRawKey;
pub use basic::mapx_ord_rawvalue::MapxOrdRawValue;
pub use basic::orphan::Orphan;
pub use basic::vecx::Vecx;
pub use basic::vecx_raw::VecxRaw;
pub use dagmap::raw::DagMapRaw;
pub use dagmap::rawkey::DagMapRawKey;
pub use dagmap::DagMapId;
pub use common::ende::KeyDe;
pub use common::ende::KeyEn;
pub use common::ende::KeyEnDe;
pub use common::ende::KeyEnDeOrdered;
pub use common::ende::ValueDe;
pub use common::ende::ValueEn;
pub use common::ende::ValueEnDe;
pub use mmdb_core;

Modules§

basic
Unversioned functions.
basic_multi_key
Multi-Key kinds of basic structures.
common
Common components
dagmap

Macros§

parse_int
Parse bytes to a specified integer type.
parse_prefix
Parse bytes to a Pre type.

Structs§

MapxRaw

Constants§

GB
KB
MB
NULL

Functions§

mmdb_flush
Flush data to disk, may take a long time.
mmdb_get_base_dir
${MMDB_BASE_DIR}
mmdb_get_custom_dir
${MMDB_CUSTOM_DIR}
mmdb_set_base_dir
Set ${MMDB_BASE_DIR} manually.

Type Aliases§

RawBytes
RawKey
RawValue