Module plugx_config::loader

source ·
Expand description

Configuration loader trait and implementations.

A configuration loader only loads contents of configurations for plugins. No parsing is done here. The result is just a Vec<(String, ConfigurationEntity)> with plugin names (in lowercase) as first element and ConfigurationEntity as values for each plugin. A loader also should try to set contents format for each plugin. For example fs loader (that loads configurations from filesystem) guesses content formats from file extensions.

Every configuration loader (every implementor of ConfigurationLoader) accepts a URL and maybe a whitelist of plugin names. It can parse the URL to detect and validate its own options. For example env (that loads configuration from environment-variables) accepts a URL like env://?prefix=MY_APP_NAME.

Also a Loader can be mark some errors skippable! For more information refer to documentation of the loader itself.

Note that generally you do not need to implement ConfigurationLoader, provided closure lets you make your own loader with just one Fn closure.

Modules

  • Custom configuration loader with Fn.
  • Environment-Variables configuration loader (env feature which is enabled by default).
  • File system configuration loader (fs feature).

Enums

Traits

Functions

  • Checks query-string part of URL and tries to deserialize it to provided type. (qs Cargo feature)