You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
der: ArrayVec replacement for SetOf/SequenceOf types #2218
These types are backed by a naively implemented internal ArrayVec which uses Option<T> as its representation. Unfortunately this means you can't do a lot of common operations on it, namely borrow its contents as a slice. It at least eschews unsafe code.
At the time it was written, the idea was this type could be swapped out for an ArrayVec type in core: rust-lang/rfcs#3316
Unfortunately after several years, no such type exists. There are various ideas of how e.g. alloc::vec::Vec could be backed by various stack-based allocators, which would be cool, but isn't yet possible.
I'm thinking perhaps we remove SetOf/SequenceOf prior to a der crate release, and potentially bring them back using some dependency like heapless or arrayvec to provide the backing implementation, so we don't have to maintain our own inferior ArrayVec type which doesn't even let you borrow its contents as a slice.
Of the above, my personal preference is probably for tinyvec since it's all safe code (also the impetus behind the old ArrayVec impl in der), so long as people can tolerate the Default bound.
However, if embedded users want heapless support, that makes sense too. Edit: actually, since we already have a heapless feature, that seems like the best option.
arrayvec seems a bit undermaintained given its widespread usage.
Activity
der: remove `SequenceOf` and `SetOf`
der: remove `SequenceOf` and `SetOf`
der: remove `SequenceOf` and `SetOf`
der: remove `SequenceOf` and `SetOf` (#2220)
tarcieri commentedon Feb 11, 2026
Alright,
SequenceOfandSetOfwere removed in #2220.Some options for a replacement:
arrayvec: 330M downloads, last release August 2024, last commit October 2024heapless: 54M downloads; last release November 2025, last commit Jan 2026tinyvec: 407M downloads, last release August 2025, last commit Jan 2026The latter is notable for being free of unsafe code, but requires a
Defaultbound onT.tarcieri commentedon Feb 11, 2026
Of the above, my personal preference is probably fortinyvecsince it's all safe code (also the impetus behind the oldArrayVecimpl inder), so long as people can tolerate theDefaultbound.However, if embedded users want
heaplesssupport, that makes sense too. Edit: actually, since we already have aheaplessfeature, that seems like the best option.arrayvecseems a bit undermaintained given its widespread usage.Add `heapless::Vec`-backed `SequenceOf` and `SetOf`
Add `heapless::Vec`-backed `SequenceOf` and `SetOf`
Add `heapless::Vec`-backed `SequenceOf` and `SetOf` (RustCrypto#2229)