pub struct InMemoryConfigSink { /* private fields */ }Expand description
In-memory writable config store.
A process-local reference ConfigSink backed by a BTreeMap. Useful for tests, defaults,
and composing override layers without touching disk or a remote backend. Cheaply cloneable;
clones share the same underlying store.
With the watch feature enabled it also implements
ConfigWatch: every set and
remove fans a change event out to active subscribers.
Implementations§
Source§impl InMemoryConfigSink
impl InMemoryConfigSink
Sourcepub fn get(&self, key: &str) -> Option<SecretString>
pub fn get(&self, key: &str) -> Option<SecretString>
Return the masked value stored at key, if present.
The returned SecretString masks its plaintext in display, debug, and serialization;
use SecretString::expose to read the plaintext intentionally.
Trait Implementations§
Source§impl Clone for InMemoryConfigSink
impl Clone for InMemoryConfigSink
Source§fn clone(&self) -> InMemoryConfigSink
fn clone(&self) -> InMemoryConfigSink
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 ConfigSink for InMemoryConfigSink
impl ConfigSink for InMemoryConfigSink
Source§impl ConfigWatch for InMemoryConfigSink
Available on crate feature watch only.
impl ConfigWatch for InMemoryConfigSink
Available on crate feature
watch only.Source§fn watch(&self, cancel: CancellationToken) -> AppResult<ConfigChangeStream>
fn watch(&self, cancel: CancellationToken) -> AppResult<ConfigChangeStream>
Subscribe to configuration changes until
cancel is triggered. Read moreSource§impl Debug for InMemoryConfigSink
impl Debug for InMemoryConfigSink
Source§impl Default for InMemoryConfigSink
impl Default for InMemoryConfigSink
Source§fn default() -> InMemoryConfigSink
fn default() -> InMemoryConfigSink
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for InMemoryConfigSink
impl !UnwindSafe for InMemoryConfigSink
impl Freeze for InMemoryConfigSink
impl Send for InMemoryConfigSink
impl Sync for InMemoryConfigSink
impl Unpin for InMemoryConfigSink
impl UnsafeUnpin for InMemoryConfigSink
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