use core::hash::{BuildHasher, Hash};
use super::{Equivalent, IndexMap};
pub struct PrivateMarker {}
pub trait MutableKeys {
type Key;
type Value;
fn get_full_mut2<Q: ?Sized>(
&mut self,
key: &Q,
) -> Option<(usize, &mut Self::Key, &mut Self::Value)>
where
Q: Hash + Equivalent<Self::Key>;
fn retain2<F>(&mut self, keep: F)
where
F: FnMut(&mut Self::Key, &mut Self::Value) -> bool;
fn __private_marker(&self) -> PrivateMarker;
}
impl<K, V, S> MutableKeys for IndexMap<K, V, S>
where
K: Eq + Hash,
S: BuildHasher,
{
type Key = K;
type Value = V;
fn get_full_mut2<Q: ?Sized>(&mut self, key: &Q) -> Option<(usize, &mut K, &mut V)>
where
Q: Hash + Equivalent<K>,
{
self.get_full_mut2_impl(key)
}
fn retain2<F>(&mut self, keep: F)
where
F: FnMut(&mut K, &mut V) -> bool,
{
self.retain_mut(keep)
}
fn __private_marker(&self) -> PrivateMarker {
PrivateMarker {}
}
}