Skip to content

der: ArrayVec replacement for SetOf/SequenceOf types #2218

@tarcieri

Description

@tarcieri

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions