Description
Hi, I forked this project a while ago (I accidently opened #29) and implemented KeyedVecSet, which is a generalized version of VecSet or VecMap.
https://github.com/youknowone/vecset-rs/blob/main/src/keyed.rs#L46-L53
KeyedVecSet<K, V> is represented as Vec<V>, but V implements Keyed<K> to provide ability to retrieve K from V.
VecMap<K, V> is a specialized case of KeyedVecSet<K, (K, V)> when fn keyed(v: (K, V)) -> K. And VecSet<K> is a specialized case of KeyedVecSet<K, K>.
I had a use case of vectors which has key in the middle of the data. And this feature worked well for my use case for a while.
If you are interested in this feature, I'd like to contribute this feature back to vecmap-rs again.
Thanks for making a good project!
Additional Information
No response
Description
Hi, I forked this project a while ago (I accidently opened #29) and implemented
KeyedVecSet, which is a generalized version ofVecSetorVecMap.https://github.com/youknowone/vecset-rs/blob/main/src/keyed.rs#L46-L53
KeyedVecSet<K, V>is represented asVec<V>, butVimplementsKeyed<K>to provide ability to retrieve K from V.VecMap<K, V>is a specialized case ofKeyedVecSet<K, (K, V)>whenfn keyed(v: (K, V)) -> K. AndVecSet<K>is a specialized case ofKeyedVecSet<K, K>.I had a use case of vectors which has key in the middle of the data. And this feature worked well for my use case for a while.
If you are interested in this feature, I'd like to contribute this feature back to vecmap-rs again.
Thanks for making a good project!
Additional Information
No response