I guess API-wise the difference between a HashMap and a Vec is whether you provide the key, or the key is generated for you. // HashMap fn insert(&mut self, val) -> key; // Vector fn insert(&mut self, index, val); The vec::push method is just a common shorthand
-
Show this thread
-
An interesting realization is that slab data structures have more in common with HashMaps than Vecs. Yet in CS terms it's usually described from a Vec/Array perspective — which makes sense from a memory perspective, but less so when considering the API.
1 reply 0 retweets 3 likesShow this thread -
Ah no I'm entirely wrong. Ahaha; just arrived back home and ooph I didn't get enough sleep.
1 reply 0 retweets 2 likesShow this thread -
Replying to @yoshuawuyts
There are definitely similarities, especially in terms of iteration apis (in addition to often supporting similar query apis). But yeah, especially in terms of your eariler comment, it's more similar to Vec
1 reply 0 retweets 1 like
Just realized "sets" are yet another distinct structure, and they def all feel very related. Think there's probably some sort of API categorization possible, but don't have the ability to think about it right now ahaha.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.