use super::{Arc, KeyValueStore, StorageBackendResult};
use crate::key_value::{KeyValueMutation, KeyValueReadScope};
pub trait OccurrenceStorage: Send + Sync {
fn read(&self, operation: &mut KeyValueReadScope<'_>) -> StorageBackendResult<()>;
fn mutate(&self, operation: &mut KeyValueMutation<'_>) -> StorageBackendResult<()>;
}
pub(super) struct KeyValueOccurrences(pub(super) Arc<dyn KeyValueStore>);
impl OccurrenceStorage for KeyValueOccurrences {
fn read(&self, operation: &mut KeyValueReadScope<'_>) -> StorageBackendResult<()> {
self.0.with_read_view(operation)
}
fn mutate(&self, operation: &mut KeyValueMutation<'_>) -> StorageBackendResult<()> {
self.0.with_mutation(operation)
}
}