use std::{hash::Hash, sync::Arc};
mod builder;
mod cache;
mod entry_selector;
mod value_initializer;
pub use {
builder::CacheBuilder,
cache::{BlockingOp, Cache},
entry_selector::{OwnedKeyEntrySelector, RefKeyEntrySelector},
};
pub type PredicateId = String;
pub(crate) struct OptionallyNone;
pub struct Iter<'i, K, V>(crate::sync_base::iter::Iter<'i, K, V>);
impl<'i, K, V> Iter<'i, K, V> {
pub(crate) fn new(inner: crate::sync_base::iter::Iter<'i, K, V>) -> Self {
Self(inner)
}
}
impl<'i, K, V> Iterator for Iter<'i, K, V>
where
K: Eq + Hash + Send + Sync + 'static,
V: Clone + Send + Sync + 'static,
{
type Item = (Arc<K>, V);
fn next(&mut self) -> Option<Self::Item> {
self.0.next()
}
}
pub trait ConcurrentCacheExt<K, V> {
fn sync(&self);
}