pub struct AsyncConfigSnapshot { /* private fields */ }Expand description
Immutable snapshot exposed by AsyncRuntimeConfig.
Implementations§
Source§impl AsyncConfigSnapshot
impl AsyncConfigSnapshot
Sourcepub fn from_configs(configs: Vec<StoredConfig>) -> Self
pub fn from_configs(configs: Vec<StoredConfig>) -> Self
Creates a snapshot from stored rows, keyed by config key.
Sourcepub fn get_model(&self, key: &str) -> Option<&StoredConfig>
pub fn get_model(&self, key: &str) -> Option<&StoredConfig>
Returns the stored model for key.
Sourcepub fn get_string_or(&self, key: &str, default: &str) -> String
pub fn get_string_or(&self, key: &str, default: &str) -> String
Returns a string value or default.
Sourcepub fn get_bool_or(&self, key: &str, default: bool) -> bool
pub fn get_bool_or(&self, key: &str, default: bool) -> bool
Returns a bool value or default.
Sourcepub fn get_i64_or(&self, key: &str, default: i64) -> i64
pub fn get_i64_or(&self, key: &str, default: i64) -> i64
Returns an i64 value or default.
Sourcepub fn get_u64_or(&self, key: &str, default: u64) -> u64
pub fn get_u64_or(&self, key: &str, default: u64) -> u64
Returns a u64 value or default.
Sourcepub fn values(&self) -> &HashMap<String, StoredConfig>
pub fn values(&self) -> &HashMap<String, StoredConfig>
Returns all values.
Trait Implementations§
Source§impl Clone for AsyncConfigSnapshot
impl Clone for AsyncConfigSnapshot
Source§fn clone(&self) -> AsyncConfigSnapshot
fn clone(&self) -> AsyncConfigSnapshot
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 AsyncConfigSnapshot
impl Debug for AsyncConfigSnapshot
Source§impl Default for AsyncConfigSnapshot
impl Default for AsyncConfigSnapshot
Source§fn default() -> AsyncConfigSnapshot
fn default() -> AsyncConfigSnapshot
Returns the “default value” for a type. Read more
Source§impl PartialEq for AsyncConfigSnapshot
impl PartialEq for AsyncConfigSnapshot
Source§fn eq(&self, other: &AsyncConfigSnapshot) -> bool
fn eq(&self, other: &AsyncConfigSnapshot) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for AsyncConfigSnapshot
impl StructuralPartialEq for AsyncConfigSnapshot
Auto Trait Implementations§
impl Freeze for AsyncConfigSnapshot
impl RefUnwindSafe for AsyncConfigSnapshot
impl Send for AsyncConfigSnapshot
impl Sync for AsyncConfigSnapshot
impl Unpin for AsyncConfigSnapshot
impl UnsafeUnpin for AsyncConfigSnapshot
impl UnwindSafe for AsyncConfigSnapshot
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more