pub struct RuntimeConfigSnapshot {
pub entries: Vec<RuntimeConfigEntry>,
}Expand description
Stable snapshot of non-default runtime configuration visible to the process.
Fields§
§entries: Vec<RuntimeConfigEntry>Sorted by key for stable JSON and machine-readable diffs.
Implementations§
Source§impl RuntimeConfigSnapshot
impl RuntimeConfigSnapshot
Sourcepub fn capture_current() -> Self
pub fn capture_current() -> Self
Capture all currently set FERRUM_* env overrides.
Sourcepub fn from_env_vars<I, K, V>(vars: I) -> Self
pub fn from_env_vars<I, K, V>(vars: I) -> Self
Build a snapshot from a supplied environment map or iterator.
Sourcepub fn from_entries<I>(entries: I) -> Selfwhere
I: IntoIterator<Item = RuntimeConfigEntry>,
pub fn from_entries<I>(entries: I) -> Selfwhere
I: IntoIterator<Item = RuntimeConfigEntry>,
Build a stable snapshot from explicit entries. Later entries for the same key replace earlier entries.
Sourcepub fn upsert(
&mut self,
key: impl Into<String>,
effective_value: impl Into<String>,
source: RuntimeConfigSource,
)
pub fn upsert( &mut self, key: impl Into<String>, effective_value: impl Into<String>, source: RuntimeConfigSource, )
Insert or replace one effective value, preserving stable key order.
Sourcepub fn upsert_entry(&mut self, entry: RuntimeConfigEntry)
pub fn upsert_entry(&mut self, entry: RuntimeConfigEntry)
Insert or replace one explicit entry, preserving stable key order.
Sourcepub fn with_entry(
self,
key: impl Into<String>,
effective_value: impl Into<String>,
source: RuntimeConfigSource,
) -> Self
pub fn with_entry( self, key: impl Into<String>, effective_value: impl Into<String>, source: RuntimeConfigSource, ) -> Self
Return a snapshot with one additional effective value.
Trait Implementations§
Source§impl Clone for RuntimeConfigSnapshot
impl Clone for RuntimeConfigSnapshot
Source§fn clone(&self) -> RuntimeConfigSnapshot
fn clone(&self) -> RuntimeConfigSnapshot
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 RuntimeConfigSnapshot
impl Debug for RuntimeConfigSnapshot
Source§impl Default for RuntimeConfigSnapshot
impl Default for RuntimeConfigSnapshot
Source§fn default() -> RuntimeConfigSnapshot
fn default() -> RuntimeConfigSnapshot
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for RuntimeConfigSnapshot
impl<'de> Deserialize<'de> for RuntimeConfigSnapshot
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for RuntimeConfigSnapshot
Source§impl PartialEq for RuntimeConfigSnapshot
impl PartialEq for RuntimeConfigSnapshot
Source§fn eq(&self, other: &RuntimeConfigSnapshot) -> bool
fn eq(&self, other: &RuntimeConfigSnapshot) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for RuntimeConfigSnapshot
impl Serialize for RuntimeConfigSnapshot
impl StructuralPartialEq for RuntimeConfigSnapshot
Auto Trait Implementations§
impl Freeze for RuntimeConfigSnapshot
impl RefUnwindSafe for RuntimeConfigSnapshot
impl Send for RuntimeConfigSnapshot
impl Sync for RuntimeConfigSnapshot
impl Unpin for RuntimeConfigSnapshot
impl UnsafeUnpin for RuntimeConfigSnapshot
impl UnwindSafe for RuntimeConfigSnapshot
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