pub struct RemoteConfig { /* private fields */ }Implementations§
Source§impl RemoteConfig
impl RemoteConfig
pub fn with_storage( app: FirebaseApp, storage: Arc<dyn RemoteConfigStorage>, ) -> Self
pub fn app(&self) -> &FirebaseApp
pub fn set_defaults(&self, defaults: HashMap<String, String>)
Sourcepub fn set_fetch_client(&self, fetch_client: Arc<dyn RemoteConfigFetchClient>)
pub fn set_fetch_client(&self, fetch_client: Arc<dyn RemoteConfigFetchClient>)
Replaces the underlying fetch client.
Useful for tests or environments that need to supply a custom transport implementation,
such as HttpRemoteConfigFetchClient.
Sourcepub fn settings(&self) -> RemoteConfigSettings
pub fn settings(&self) -> RemoteConfigSettings
Returns a copy of the current Remote Config settings.
Mirrors the JS remoteConfig.settings property.
Sourcepub fn set_config_settings(
&self,
update: RemoteConfigSettingsUpdate,
) -> RemoteConfigResult<()>
pub fn set_config_settings( &self, update: RemoteConfigSettingsUpdate, ) -> RemoteConfigResult<()>
Applies validated settings to the Remote Config instance.
Equivalent to the JS setConfigSettings helper. Values are merged with the existing
configuration and validated before being applied.
§Examples
use firebase_rs_sdk::remote_config::settings::RemoteConfigSettingsUpdate;
let rc = get_remote_config(Some(app))?;
rc.set_config_settings(RemoteConfigSettingsUpdate {
fetch_timeout_millis: Some(90_000),
minimum_fetch_interval_millis: Some(3_600_000),
})?;pub fn fetch(&self) -> RemoteConfigResult<()>
pub fn activate(&self) -> RemoteConfigResult<bool>
Sourcepub fn fetch_time_millis(&self) -> i64
pub fn fetch_time_millis(&self) -> i64
Returns the timestamp (in milliseconds since epoch) of the last successful fetch.
Mirrors remoteConfig.fetchTimeMillis from the JS SDK, returning -1 when no successful
fetch has completed yet.
Sourcepub fn last_fetch_status(&self) -> FetchStatus
pub fn last_fetch_status(&self) -> FetchStatus
Returns the status of the last fetch attempt.
Matches the JS remoteConfig.lastFetchStatus property.
Sourcepub fn active_template_version(&self) -> Option<u64>
pub fn active_template_version(&self) -> Option<u64>
Returns the template version of the currently active Remote Config, if known.
Sourcepub fn get_string(&self, key: &str) -> String
pub fn get_string(&self, key: &str) -> String
Returns the raw string value for a parameter.
Mirrors the JS helper getString defined in packages/remote-config/src/api.ts.
Sourcepub fn get_boolean(&self, key: &str) -> bool
pub fn get_boolean(&self, key: &str) -> bool
Returns the value interpreted as a boolean.
Maps to the JS helper getBoolean.
Sourcepub fn get_number(&self, key: &str) -> f64
pub fn get_number(&self, key: &str) -> f64
Returns the value interpreted as a number.
Maps to the JS helper getNumber.
Sourcepub fn get_value(&self, key: &str) -> RemoteConfigValue
pub fn get_value(&self, key: &str) -> RemoteConfigValue
Returns a value wrapper that exposes typed accessors and the source of the parameter.
Sourcepub fn get_all(&self) -> HashMap<String, RemoteConfigValue>
pub fn get_all(&self) -> HashMap<String, RemoteConfigValue>
Returns the union of default and active configs, with active values taking precedence.
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