rust-embedded / rust-embedded/heapless
Add usize index methods to IndexMap
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 2k
- Forks
- 253
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 1
Description
For my usecase, I need to be able to refer to IndexMap keys by usize index as well as by their keys. Specifically, I would like access to the .insert_full(k, v) method and the Index<usize> trait implemented, from the upstream non-heapless IndexMap. Otherwise I'm better off using a plain Vec and doing linear searches, so that I can use both keys and fast usize indexing.
One alternative to the above would be Entry's .index() and IndexMap's .get_index(i) methods, which would also allow me to save the index of a key when I insert it, then read from it later.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Compare heapless IndexMap with the upstream non-heapless IndexMap, starting from the requested insert_full, Index<usize>, Entry::index(), and get_index() APIs. Done means the requested usize-based access methods are available with behavior consistent with the upstream implementation; the issue does not name specific files or tests to run.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100