uqa_storage/key_value/inverted_index/
storage.rs1use super::{Arc, KeyValueStore, StorageBackendResult};
10use crate::key_value::{KeyValueMutation, KeyValueReadScope};
11
12pub trait OccurrenceStorage: Send + Sync {
14 fn read(&self, operation: &mut KeyValueReadScope<'_>) -> StorageBackendResult<()>;
15 fn mutate(&self, operation: &mut KeyValueMutation<'_>) -> StorageBackendResult<()>;
16}
17
18pub(super) struct KeyValueOccurrences(pub(super) Arc<dyn KeyValueStore>);
19
20impl OccurrenceStorage for KeyValueOccurrences {
21 fn read(&self, operation: &mut KeyValueReadScope<'_>) -> StorageBackendResult<()> {
22 self.0.with_read_view(operation)
23 }
24 fn mutate(&self, operation: &mut KeyValueMutation<'_>) -> StorageBackendResult<()> {
25 self.0.with_mutation(operation)
26 }
27}