rust-embedded / rust-embedded/heapless
Feature: Support a fixed-dynamic-capacity Vec
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 2k
- Forks
- 253
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 1
Description
So, a dynamically sized Vec, but still with a max capacity. This would remain heapless, as you can construct the slice on the stack or static and pass it in. There are some particular advantages to this approach in an embedded environment, the biggest of which being the lack of monomorphization required to support multiple capacities. A . It can also be safely produced from a SliceVec<'a, T> with dynamic length N can be produced via a method on &'a mut Vec<T, N>&'a mut [MaybeUninit<T>] and &'a mut [T], since we never write new uninit data.
A SliceVec can also be used on external buffers, such as keeping track of how many bytes of an uninit buffer have been written to and provide a safe method to retrieve the initialized bytes. This is particularly useful for zero-copy deserialization.
If I were send a PR to add this, would it be accepted? This is a blocker for my team switching to heapless off of FixedVec, which has less support and fewer types to work with.
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
The issue names no repository files or tests; begin by reviewing the existing Vec API and the linked FixedVec reference. Clarify and agree on the SliceVec API, supported buffer forms, safety guarantees, and tests before implementation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- embedded-iot
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100