_TinyArray

public struct _TinyArray<Element>
extension _TinyArray: RandomAccessCollection
extension _TinyArray: Equatable where Element: Equatable
extension _TinyArray: Hashable where Element: Hashable
extension _TinyArray: Sendable where Element: Sendable

TinyArray is a RandomAccessCollection optimised to store zero or one Element. It supports arbitrary many elements but if only up to one Element is stored it does not allocate separate storage on the heap and instead stores the Element inline.

TinyArray “public” interface