pub struct MemoryStore { /* private fields */ }Expand description
Overrides in a map, for a single process.
Cheap to clone, and clones share one map, so the store can be handed to a
Flags and still be written to from an admin route.
The limitation is the obvious one and it is worth saying out loud: an override set here reaches this process and no other. On one machine that is everything; behind a load balancer it means an operator turning a flag off has turned it off for a third of the traffic. This is the right store for a single-process application, for tests, and for a default that works before anybody has chosen a database — and the wrong one for an incident switch across a fleet.
Implementations§
Trait Implementations§
Source§impl Clone for MemoryStore
impl Clone for MemoryStore
Source§fn clone(&self) -> MemoryStore
fn clone(&self) -> MemoryStore
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 Default for MemoryStore
impl Default for MemoryStore
Source§fn default() -> MemoryStore
fn default() -> MemoryStore
Returns the “default value” for a type. Read more
Source§impl FlagStore for MemoryStore
impl FlagStore for MemoryStore
Source§fn get<'a>(
&'a self,
flag: &'a str,
scope: &'a Scope,
) -> BoxFuture<'a, Result<Option<bool>>>
fn get<'a>( &'a self, flag: &'a str, scope: &'a Scope, ) -> BoxFuture<'a, Result<Option<bool>>>
The override for one flag and scope:
None when nobody has set one. Read moreSource§fn set<'a>(
&'a self,
flag: &'a str,
scope: &'a Scope,
value: bool,
) -> BoxFuture<'a, Result<()>>
fn set<'a>( &'a self, flag: &'a str, scope: &'a Scope, value: bool, ) -> BoxFuture<'a, Result<()>>
Write an override, replacing any that was there.
Auto Trait Implementations§
impl Freeze for MemoryStore
impl RefUnwindSafe for MemoryStore
impl Send for MemoryStore
impl Sync for MemoryStore
impl Unpin for MemoryStore
impl UnsafeUnpin for MemoryStore
impl UnwindSafe for MemoryStore
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