pub struct RemoteConfig {
pub parameters: Option<HashMap<String, RemoteConfigParameter>>,
pub conditions: Option<Vec<RemoteConfigCondition>>,
}Expand description
The RemoteConfig consists of a list of conditions (which can be thought of as named “if” statements) and a map of parameters (parameter key to a structure containing an optional default value, as well as a optional submap of (condition name to value when that condition is true).
§Activities
This type is used in activities, which are methods you may call on this type or where this type is involved in. The list links the activity name, along with information about where it is used (one of request and response).
- get remote config projects (response)
- update remote config projects (request|response)
Fields§
§parameters: Option<HashMap<String, RemoteConfigParameter>>Map of parameter keys to their optional default values and optional submap of (condition name : value). Order doesn’t affect semantics, and so is sorted by the server. The ‘key’ values of the params must be unique.
conditions: Option<Vec<RemoteConfigCondition>>The list of named conditions. The order does affect the semantics. The condition_name values of these entries must be unique.
The resolved value of a config parameter P is determined as follow:
- Let Y be the set of values from the submap of P that refer to conditions
that evaluate to
true. - If Y is non empty, the value is taken from the specific submap in Y whose condition_name is the earliest in this condition list.
- Else, if P has a default value option (condition_name is empty) then the value is taken from that option.
- Else, parameter P has no value and is omitted from the config result.
Example: parameter key “p1”, default value “v1”, submap specified as {“c1”: v2, “c2”: v3} where “c1” and “c2” are names of conditions in the condition list (where “c1” in this example appears before “c2”). The value of p1 would be v2 as long as c1 is true. Otherwise, if c2 is true, p1 would evaluate to v3, and if c1 and c2 are both false, p1 would evaluate to v1. If no default value was specified, and c1 and c2 were both false, no value for p1 would be generated.
Trait Implementations§
Source§impl Clone for RemoteConfig
impl Clone for RemoteConfig
Source§fn clone(&self) -> RemoteConfig
fn clone(&self) -> RemoteConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more