pub struct ContextStore { /* private fields */ }Expand description
Holds the permanent base and an optional pushed overlay.
Implementations§
Source§impl ContextStore
impl ContextStore
Sourcepub fn new(base: HashMap<String, String>) -> ContextStore
pub fn new(base: HashMap<String, String>) -> ContextStore
base is the merged static ⊕ env map (env precedence applied by the caller).
Sourcepub fn push(&self, values: HashMap<String, String>, ttl: Option<Duration>)
pub fn push(&self, values: HashMap<String, String>, ttl: Option<Duration>)
Replace the overlay with values, expiring after ttl (None = no expiry).
pub fn resolve(&self) -> ResolvedContext
Sourcepub fn resolve_at(&self, now: Instant) -> ResolvedContext
pub fn resolve_at(&self, now: Instant) -> ResolvedContext
Base overlaid by a live overlay (overlay keys win). Expired overlay is dropped.
Auto Trait Implementations§
impl !Freeze for ContextStore
impl RefUnwindSafe for ContextStore
impl Send for ContextStore
impl Sync for ContextStore
impl Unpin for ContextStore
impl UnsafeUnpin for ContextStore
impl UnwindSafe for ContextStore
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