use std::fmt::Debug;
use std::hash::Hash;
use std::sync::Arc;
use tokio::sync::Mutex;
#[derive(Debug)]
pub struct EntryValue<V> {
pub(super) value: Option<V>,
}
type Entry<V> = Arc<Mutex<EntryValue<V>>>;
pub enum GetOrInsertNoneResult<V> {
Existing(V),
Inserted(V),
}
pub trait ArcMutexMapLike: IntoIterator<Item = (Self::K, Entry<Self::V>)> {
type K: Eq + PartialEq + Hash + Clone;
type V;
type ItemIter<'a>: Iterator<Item = (&'a Self::K, &'a Entry<Self::V>)>
where
Self: 'a,
Self::K: 'a,
Self::V: 'a;
fn new() -> Self;
fn len(&self) -> usize;
fn get_or_insert_none(&mut self, key: &Self::K) -> GetOrInsertNoneResult<Entry<Self::V>>;
fn get(&mut self, key: &Self::K) -> Option<&Entry<Self::V>>;
fn remove(&mut self, key: &Self::K) -> Option<Entry<Self::V>>;
fn iter(&self) -> Self::ItemIter<'_>;
}