Embassy
ekv

Crates

git

Versions

default

Flavors

Module ekv::config

source ·
Expand description

Compile-time configuration.

ekv has some configuration settings that are set at compile time.

They can be set in two ways:

  • Via Cargo features: enable a feature like <name>-<value>. name must be in lowercase and use dashes instead of underscores. For example. max-page-count-1024. Only a selection of values is available, check Cargo.toml for the list.
  • Via environment variables at build time: set the variable named EKV_<value>. For example EKV_MAX_PAGE_COUNT=1024 cargo build. You can also set them in the [env] section of .cargo/config.toml. Any value can be set, unlike with Cargo features.

Environment variables take precedence over Cargo features. If two Cargo features are enabled for the same setting with different values, compilation fails.

Compatibility warning

Changing ANY of these configuration settings changes the on-disk format of the database. If you change them, you won’t be able to read databases written with a different configuration.

Currently, mounting doesn’t check the on-disk database uses the same configuration. Mounting a database with a different configuration might succeed and then cause fun errors later, perhaps very rarely. Always remember to format your flash device every time you change them.

Constants

Functions

  • Dump the compile-time configuration to log or defmt.