pub struct SharedSeriesMap<T: DataPoint> { /* private fields */ }Expand description
Arc<RwLock<HashMap<Key, Arc<RwLock<Series<T>>>>>> — MLC dual-read pattern.
Outer RwLock guards the map structure (only locked briefly during get_or_create). Inner RwLock per-series allows independent reads/writes across keys without serializing on the map mutex.
Implementations§
pub fn new(default_capacity: usize) -> Self
Sourcepub async fn get_or_create(&self, key: SeriesKey) -> Arc<RwLock<Series<T>>> ⓘ
pub async fn get_or_create(&self, key: SeriesKey) -> Arc<RwLock<Series<T>>> ⓘ
Return existing series or create + insert an empty one.
pub async fn get(&self, key: &SeriesKey) -> Option<Arc<RwLock<Series<T>>>>
pub async fn remove(&self, key: &SeriesKey) -> Option<Arc<RwLock<Series<T>>>>
pub async fn len(&self) -> usize
pub async fn keys(&self) -> Vec<SeriesKey>
Trait Implementations§
Auto Trait Implementations§
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