pub struct InMemoryStore {
data: RwLock<BTreeMap<(u64, u32, i64), TemporalPoint>>,
}Expand description
Non-persistent in-memory storage using a sorted BTreeMap.
Thread-safe: multiple readers or one writer via [RwLock].
All data is lost when the process exits.
Fields§
§data: RwLock<BTreeMap<(u64, u32, i64), TemporalPoint>>Implementations§
Trait Implementations§
Source§impl Default for InMemoryStore
impl Default for InMemoryStore
Source§impl StorageBackend for InMemoryStore
impl StorageBackend for InMemoryStore
Source§fn get(
&self,
entity_id: u64,
space_id: u32,
timestamp: i64,
) -> Result<Option<TemporalPoint>, StorageError>
fn get( &self, entity_id: u64, space_id: u32, timestamp: i64, ) -> Result<Option<TemporalPoint>, StorageError>
Retrieve a single point by entity, space, and timestamp.
Source§fn put(&self, space_id: u32, point: &TemporalPoint) -> Result<(), StorageError>
fn put(&self, space_id: u32, point: &TemporalPoint) -> Result<(), StorageError>
Store a temporal point.
Auto Trait Implementations§
impl !Freeze for InMemoryStore
impl !RefUnwindSafe for InMemoryStore
impl Send for InMemoryStore
impl Sync for InMemoryStore
impl Unpin for InMemoryStore
impl UnwindSafe for InMemoryStore
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