// This source code is released into the public domain. export module nihil.config:store; // The configuration store. There should only be one of these. import nihil.std; import nihil.error; import nihil.generator; namespace nihil::config { export struct option; struct store final { /* * Get the global config store. */ [[nodiscard]] static auto get() -> store &; /* * Register a new value with the config store. */ [[nodiscard]] auto register_option(this store &, option *object) -> std::expected; /* * Remove a value from the config store. */ [[nodiscard]] auto unregister_option(this store &, option *object) -> std::expected; /* * Fetch an existing value in the config store. */ [[nodiscard]] auto fetch(this store const &, std::string_view name) -> std::expected