pub struct RemoteConfigValue { /* private fields */ }Expand description
Represents a Remote Config parameter value with typed accessors.
This follows the behaviour of the JavaScript Value class where missing keys map to a static
source with empty string defaults.
Implementations§
Source§impl RemoteConfigValue
impl RemoteConfigValue
Sourcepub fn as_string(&self) -> String
pub fn as_string(&self) -> String
Returns the raw value as a string.
§Examples
use firebase_rs_sdk::remote_config::value::RemoteConfigValue;
let value = RemoteConfigValue::default();
assert_eq!(value.as_string(), "");Sourcepub fn as_bool(&self) -> bool
pub fn as_bool(&self) -> bool
Returns the value interpreted as a boolean.
Matches the JS SDK semantics: true for case-insensitive values in
{"1", "true", "t", "yes", "y", "on"} when the source is remote/default, otherwise false.
Sourcepub fn as_number(&self) -> f64
pub fn as_number(&self) -> f64
Returns the value interpreted as a number.
Parsing failures fall back to 0.0, mirroring the JavaScript implementation.
Sourcepub fn source(&self) -> RemoteConfigValueSource
pub fn source(&self) -> RemoteConfigValueSource
Returns the source of the value (remote, default, static).
Trait Implementations§
Source§impl Clone for RemoteConfigValue
impl Clone for RemoteConfigValue
Source§fn clone(&self) -> RemoteConfigValue
fn clone(&self) -> RemoteConfigValue
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RemoteConfigValue
impl Debug for RemoteConfigValue
Source§impl Default for RemoteConfigValue
impl Default for RemoteConfigValue
Source§impl PartialEq for RemoteConfigValue
impl PartialEq for RemoteConfigValue
impl Eq for RemoteConfigValue
impl StructuralPartialEq for RemoteConfigValue
Auto Trait Implementations§
impl Freeze for RemoteConfigValue
impl RefUnwindSafe for RemoteConfigValue
impl Send for RemoteConfigValue
impl Sync for RemoteConfigValue
impl Unpin for RemoteConfigValue
impl UnwindSafe for RemoteConfigValue
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.