Suppose we have:
pub struct Idx<V> {
pub m_idx: usize,
_t: PhantomData<V>,}
Now, suppose we have a
pub struct TypedVec<K, V> {
data: Vec<V>,
_t: PhantomData<K>,
}
and TypedVec<K, V>
behaves just like a Vec<V>
except that instead of indexing with usize, it indexes with Idx<K>
.
This basically involves impling lots of functions on TypedVec<K, V>
. Is there an existing crate that solves this ?