pub struct SyncConfigSnapshot<T = StoredConfig> { /* private fields */ }Expand description
Immutable generic snapshot used by synchronous runtime caches.
Implementations§
Source§impl<T> SyncConfigSnapshot<T>where
T: RuntimeConfigRecord,
impl<T> SyncConfigSnapshot<T>where
T: RuntimeConfigRecord,
Sourcepub fn from_configs(configs: Vec<T>) -> Self
pub fn from_configs(configs: Vec<T>) -> Self
Creates a snapshot from stored rows, keyed by config 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.
Trait Implementations§
Source§impl<T: Clone> Clone for SyncConfigSnapshot<T>
impl<T: Clone> Clone for SyncConfigSnapshot<T>
Source§fn clone(&self) -> SyncConfigSnapshot<T>
fn clone(&self) -> SyncConfigSnapshot<T>
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<T> ConfigValueLookup for SyncConfigSnapshot<T>where
T: RuntimeConfigRecord,
impl<T> ConfigValueLookup for SyncConfigSnapshot<T>where
T: RuntimeConfigRecord,
Source§impl<T: Debug> Debug for SyncConfigSnapshot<T>
impl<T: Debug> Debug for SyncConfigSnapshot<T>
Source§impl<T> Default for SyncConfigSnapshot<T>
impl<T> Default for SyncConfigSnapshot<T>
Source§impl<T: PartialEq> PartialEq for SyncConfigSnapshot<T>
impl<T: PartialEq> PartialEq for SyncConfigSnapshot<T>
Source§fn eq(&self, other: &SyncConfigSnapshot<T>) -> bool
fn eq(&self, other: &SyncConfigSnapshot<T>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<T: Eq> Eq for SyncConfigSnapshot<T>
impl<T> StructuralPartialEq for SyncConfigSnapshot<T>
Auto Trait Implementations§
impl<T> Freeze for SyncConfigSnapshot<T>
impl<T> RefUnwindSafe for SyncConfigSnapshot<T>where
T: RefUnwindSafe,
impl<T> Send for SyncConfigSnapshot<T>where
T: Send,
impl<T> Sync for SyncConfigSnapshot<T>where
T: Sync,
impl<T> Unpin for SyncConfigSnapshot<T>where
T: Unpin,
impl<T> UnsafeUnpin for SyncConfigSnapshot<T>
impl<T> UnwindSafe for SyncConfigSnapshot<T>where
T: UnwindSafe,
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