pub struct InMemoryStateStore { /* private fields */ }Expand description
Default in-process backend backed by a lock-free HopscotchMap.
Suitable for single-process deployments; not durable across restarts.
Integer counters get their own HopscotchMap<String, Arc<AtomicI64>>
so increment_i64 can CAS atomically without RMW-racing through the
byte-keyed bucket. Readers of the byte store see the counter value
as decimal ASCII on get(key) after an increment - this mirrors the
JS polyfill’s setJSON/getJSON contract.
Implementations§
Trait Implementations§
Source§impl Default for InMemoryStateStore
impl Default for InMemoryStateStore
Source§fn default() -> InMemoryStateStore
fn default() -> InMemoryStateStore
Returns the “default value” for a type. Read more
Source§impl StateStore for InMemoryStateStore
impl StateStore for InMemoryStateStore
fn get(&self, key: &str) -> Option<Vec<u8>>
fn set(&self, key: &str, value: Vec<u8>)
fn delete(&self, key: &str)
Auto Trait Implementations§
impl !Freeze for InMemoryStateStore
impl !RefUnwindSafe for InMemoryStateStore
impl !UnwindSafe for InMemoryStateStore
impl Send for InMemoryStateStore
impl Sync for InMemoryStateStore
impl Unpin for InMemoryStateStore
impl UnsafeUnpin for InMemoryStateStore
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