pub trait ConfigurationProvider:
Environment
+ Send
+ Sync {
// Required methods
fn GetConfigurationValue<'life0, 'async_trait>(
&'life0 self,
Section: Option<String>,
Overrides: ConfigurationOverridesDTO,
) -> Pin<Box<dyn Future<Output = Result<Value, CommonError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn UpdateConfigurationValue<'life0, 'async_trait>(
&'life0 self,
Key: String,
ValueToSet: Value,
Target: ConfigurationTarget,
Overrides: ConfigurationOverridesDTO,
ScopeToLanguage: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
An abstract service contract for an environment component that can provide
the final, merged configuration values and handle requests to update those
values in their persistent storage (e.g., settings.json files).
Required Methods§
Sourcefn GetConfigurationValue<'life0, 'async_trait>(
&'life0 self,
Section: Option<String>,
Overrides: ConfigurationOverridesDTO,
) -> Pin<Box<dyn Future<Output = Result<Value, CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn GetConfigurationValue<'life0, 'async_trait>(
&'life0 self,
Section: Option<String>,
Overrides: ConfigurationOverridesDTO,
) -> Pin<Box<dyn Future<Output = Result<Value, CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieves a configuration value for a given section or key, applying specified overrides.
This method should return the final, effective value after merging all configuration sources (e.g., default, user, workspace) in the correct order of precedence.
§Parameters
Section: An optional, dot-separated key to a specific configuration section. IfNone, the entire configuration object should be returned.Overrides: A DTO specifying scope overrides (e.g., for a specific resource or language).
§Returns
A Result containing the requested configuration as a
serde_json::Value.
Sourcefn UpdateConfigurationValue<'life0, 'async_trait>(
&'life0 self,
Key: String,
ValueToSet: Value,
Target: ConfigurationTarget,
Overrides: ConfigurationOverridesDTO,
ScopeToLanguage: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn UpdateConfigurationValue<'life0, 'async_trait>(
&'life0 self,
Key: String,
ValueToSet: Value,
Target: ConfigurationTarget,
Overrides: ConfigurationOverridesDTO,
ScopeToLanguage: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Updates a configuration value at a specific key and target scope.
§Parameters
Key: The dot-separated configuration key to update.ValueToSet: The newserde_json::Valueto set for the key.Target: TheConfigurationTargetenum specifying which scope to write to (e.g., User, WorkSpace).Overrides: A DTO for scope overrides.ScopeToLanguage: An optional flag related to language-specific settings.