use crate::store::adapter::slab::{Iter, IterMut, Keys, Values};
use crate::store::item::{Key, Value};
use crate::store::{StoreIterable, StoreIterableMut, StoreKeys, StoreValues};
use super::Stash;
impl<K, V, S> StoreIterable<K, V> for Stash<K, V, S>
where
K: Key,
V: Value,
S: StoreIterable<K, usize>,
{
type Iter<'a> = Iter<'a, K, V>
where
Self: 'a;
#[inline]
fn iter(&self) -> Self::Iter<'_> {
StoreIterable::iter(&self.items)
}
}
impl<K, V, S> StoreIterableMut<K, V> for Stash<K, V, S>
where
K: Key,
V: Value,
S: StoreIterableMut<K, usize>,
{
type IterMut<'a> = IterMut<'a, K, V>
where
Self: 'a;
#[inline]
fn iter_mut(&mut self) -> Self::IterMut<'_> {
StoreIterableMut::iter_mut(&mut self.items)
}
}
impl<K, V, S> StoreKeys<K, V> for Stash<K, V, S>
where
K: Key,
S: StoreKeys<K, usize>,
{
type Keys<'a> = Keys<'a, K, V>
where
Self: 'a;
#[inline]
fn keys(&self) -> Self::Keys<'_> {
StoreKeys::keys(&self.items)
}
}
impl<K, V, S> StoreValues<K, V> for Stash<K, V, S>
where
K: Key,
V: Value,
S: StoreValues<K, usize>,
{
type Values<'a> = Values<'a, K, V>
where
Self: 'a;
#[inline]
fn values(&self) -> Self::Values<'_> {
StoreValues::values(&self.items)
}
}