I'm re-implementing a hashtable in Rust. Eventually I'd like to make this distributed and have quorums, but for now it's a hashtable on a single system.
I want the size of the table to be passed in as an argument so the table should be dynamically sized. I don't want the table to grow because that will mess with my hash function which works off a modulo operation. I see a couple of options:
- Arrays - cannot be dynamically sized
- Vectors - can grow
- Slices - can be dynamically sized & can't grow, but are just views onto
Vec
s and arrays, so I'll need aVec
/array anyways?
In C++, I could have just used a dynamically sized array. What's the best choice here?