pub struct InMemoryStore<Id, State> { /* private fields */ }Expand description
In-process StateStore backed by a RwLock<HashMap>.
Thread-safe for concurrent reads and writes. Suitable for single-process
deployments and testing; for distributed setups, use a shared backend
like Redis (see loadwise-store-redis).
Implementations§
Source§impl<Id, State> InMemoryStore<Id, State>
impl<Id, State> InMemoryStore<Id, State>
Trait Implementations§
Source§impl<Id, State> Default for InMemoryStore<Id, State>
impl<Id, State> Default for InMemoryStore<Id, State>
Source§impl<Id, State> StateStore for InMemoryStore<Id, State>
impl<Id, State> StateStore for InMemoryStore<Id, State>
type NodeId = Id
type State = State
type Error = Infallible
Source§fn get(&self, id: &Id) -> Result<Option<State>, Self::Error>
fn get(&self, id: &Id) -> Result<Option<State>, Self::Error>
Fetch the state for a single node, or
None if absent.Auto Trait Implementations§
impl<Id, State> !Freeze for InMemoryStore<Id, State>
impl<Id, State> RefUnwindSafe for InMemoryStore<Id, State>
impl<Id, State> Send for InMemoryStore<Id, State>
impl<Id, State> Sync for InMemoryStore<Id, State>
impl<Id, State> Unpin for InMemoryStore<Id, State>
impl<Id, State> UnsafeUnpin for InMemoryStore<Id, State>
impl<Id, State> UnwindSafe for InMemoryStore<Id, State>
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