heapless
`static` friendly data structures that don't require dynamic memory allocation
0.9.3
125M downloads/mo
#711 most downloaded on crates.io
rust-embedded/heapless
What this package is like to depend on
Last release 3 months ago
30 Apr 2026
Release timing varies
gaps range from 3 weeks to 1.4 years
Nearly every release is documented
notes for 52 of 53 stable releases
3 versions withdrawn
withdrawn after publishing
9 years old
56 releases · first in 2017
2 releases in the last 12 months
see the full history below
Release timeline
56 releases · Apr 2017 to Apr 2026Releases
latest 56-
0.9.330 Apr 2026Release notes
Open source →See the full changelog here: https://github.com/rust-embedded/heapless/blob/v0.9.3/CHANGELOG.md#v093-2025-04-15
Release notes
Open source →- Fixed unsoundness in
Deque::clear,HistoryBuf::clearandIndexMap::clearin the context of panicking drop implementations. - Added
from_bytes_truncating_at_nultoCString - Added
CString::{into_bytes, into_bytes_with_nul, into_string} - Added
pop_front_ifandpop_back_iftoDeque - Made
Vec::from_arrayconst. - Fixed long division being instroduced by the const-erasure in spsc
- spsc: Fix integer overflow in iterators when N > usize::MAX/2 and the queue loops.
- spsc: Fix integer overflow leading to a panic in
lenwhen N == usize::MAX and debug assertions are enabled.
Release notes
Open source →- Fixed unsoundness in
Deque::clear,HistoryBuf::clearandIndexMap::clearin the context of panicking drop implementations. - Added
from_bytes_truncating_at_nultoCString - Added
CString::{into_bytes, into_bytes_with_nul, into_string} - Added
pop_front_ifandpop_back_iftoDeque - Made
Vec::from_arrayconst.
- Fixed unsoundness in
-
0.9.212 Nov 2025Release notes
Open source →See the full changelog here: https://github.com/rust-embedded/heapless/blob/v0.9.2/CHANGELOG.md#v092
Release notes
Open source →- Added
from_bytes_truncating_at_nultoCString - Added missing
?Sizedbounds inPartialEqimplementations - Make
PartialEqimplementation forDequeInnerandHistoryBufInnergeneric over the storage of the RHS - Minor fixes to module docs.
- Make MSRV of 1.87.0 explicit.
- Implement
DefaultforCapacityError. - Implement
defmt::FormatforCapacityError. - Implement
TryFromforDequefrom array. - Switch from
serdetoserde_corefor enabling faster compilations. - Implement
Zeroizetrait for all data structures with thezeroizefeature to securely clear sensitive data from memory. - Added
truncatetoDeque - Added
retaintoDeque - Added
retain_muttoDeque - Added
into_rawtoBox - Added
from_rawtoBox - Added
FusedIteratortovec::IntoIter,deque::IntoIter,index_map::IntoIterandlinear_map::IntoIter. - Added
ExactSizeIteratortovec::IntoIter,deque::IntoIter,index_map::IntoIterandlinear_map::IntoIter. - Added
DoubleEndedIteratortovec::IntoIteranddeque::IntoIter. - Deprecate
mpmc(see #583) - Fixed initialization of the
ArcBlock<T>andBoxBlock<T>types, fixing possible Undefined Behavior
- Added
-
0.9.120 Aug 2025Release notes
Open source →See the full changelog here: https://github.com/rust-embedded/heapless/blob/v0.9.1/CHANGELOG.md#v091
Release notes
Open source →Added
- Added
String::insertandString::insert_str.
Added
- Added optional
embedded_io::Writeimpl forVec.
Changed
bytes::BufMutis now implemented onVecInner.- Removed generic from
history_buf::OldestOrdered. - Made
LenTypeopt-in. - Minor fixes to
pool::boxeddocs. - Add missing
Debugderive tovec::IntoIter. - Removed generic from
spsc::Consumer,spsc::Producerandspsc::Iter. - Added
LinearMap::entry()API. - Added
LinearMap::retain().
Fixed
- CI now uses flags specified in
Cargo.tomlforrustdoctests. - Fixed clippy lints.
- Fixed the memory layout of the internal
UnionNode<T>type, fixing possible Undefined Behaviour.
Removed
- Removed invalid
bytes::Bufimplementation. - Removed
DefaultLenTypestruct.
- Added
-
0.9.028 Apr 2025 withdrawnRelease notes
Open source →See the full changelog here: https://github.com/rust-embedded/heapless/blob/v0.9.0/CHANGELOG.md#v090---2025-04-28
Release notes
Open source →Added
- Added
bytes::Bufandbytes::BufMutimplementations forVec. - Added
formatmacro. - Added
String::from_utf16. - Added
is_full,recent_index,oldest, andoldest_indextoHistoryBuffer - Added
is_fulltoBinaryHeap - Added
is_fulltoIndexMap - Added
is_fulltoIndexSet - Added
is_fulltoLinearMap - Added infallible conversions from arrays to
Vec. - Added
Vec::spare_capacity_mut. - Added
Extendimpls forDeque. - Added
Deque::make_contiguous. - Added
VecView, the!Sizedversion ofVec. - Added pool implementations for 64-bit architectures.
- Added
IntoIteratorimplementation forLinearMap - Added
Deque::{get, get_mut, get_unchecked, get_unchecked_mut}. - Added
serde::Serializeandserde::Deserializeimplementations toHistoryBuffer. - Added
Vec::drain. - Added
String::drain. - Implemented
DoubleEndedIteratorforOldestOrdered. - Added std
Entrymethods to indexmapEntry. - Added
StringView, the!Sizedversion ofString. - Added
BinaryHeapView, the!Sizedversion ofBinaryHeap. - Added
MpMcQueueView, the!Sizedversion ofMpMcQueue. - Added
LinearMapView, the!Sizedversion ofLinearMap. - Added
HistoryBufferView, the!Sizedversion ofHistoryBuffer. - Added
DequeView, the!Sizedversion ofDeque. - Added
QueueView, the!Sizedversion ofQueue. - Added
SortedLinkedListView, the!Sizedversion ofSortedLinkedList. - Added implementation of
BorrowandBorrowMutforStringandVec. - Added
Deque::{swap, swap_unchecked, swap_remove_front, swap_remove_back}. - Make
String::from_utf8_uncheckedconst. - Implemented
PartialEqandEqforDeque. - Added
allocfeature to enablealloc-Vec interoperability. - Added
TryFrom<alloc::vec::Vec>impl forVec. - Added
TryFrom<Vec>impl foralloc::vec::Vec. - Added
truncatetoIndexMap. - Added
get_indexandget_index_muttoIndexMap. - Added
String::uDisplay. - Added
CString. - Added
LenTgeneric toVec<T, N>andVecView<T>to save memory when using a sane capacity value. - Added the
index_setmodule. - Added the
index_mapmodule. - Migrated
Idxgeneric forSortedLinkedListto use the newLenTypetrait, allowing forIdxinference. - Added similar
LenTgeneric toString. - Optimize size of zero capacity
Vec<T, 0>to be 0 bytes
Changed
- Updated defmt from 0.3 to 1.0.1
- Changed the feature name from
defmt-03todefmt.
- Changed the feature name from
- Changed the error type of these methods from
()toCapacityError.String::push_strString::pushVec::extend_from_sliceVec::from_sliceVec::resize_defaultVec::resize
- Renamed
FromUtf16Error::DecodeUtf16ErrortoFromUtf16Error::DecodeUtf16. - Changed
stable_deref_traitto a platform-dependent dependency. - Changed
SortedLinkedList::popreturn type fromResult<T, ()>toOption<T>to matchstd::vec::pop. Vec::capacityis no longer aconstfunction.- Relaxed bounds on
PartialEqforIndexMapfromV: EqtoV1: PartialEq<V2>. - Relaxed bounds on
PartialEqforLinearMapfromV: PartialEqtoV1: PartialEq<V2>. - The
FnvIndexSettype is now inside theindex_setmodule. - The
IndexSetItertype is now inside theindex_setmodule and has been renamed toIter. - The
Buckettype is now inside theindex_mapmodule. - The
Entrytype is now inside theindex_mapmodule. - The
FnvIndexMaptype is now inside theindex_mapmodule. - The
IndexMapItertype is now inside theindex_mapmodule and has been renamed toIter. - The
IndexMapIterMuttype is now inside theindex_mapmodule and has been renamed toIterMut. - The
IndexMapKeystype is now inside theindex_mapmodule and has been renamed toKeys. - The
OccupiedEntrytype is now inside theindex_mapmodule. - The
Postype is now inside theindex_mapmodule. - The
VacantEntrytype is now inside theindex_mapmodule. - The
VacantEntrytype is now inside theindex_mapmodule. - The
IndexMapValuestype is now inside theindex_mapmodule and has been renamed toValues. - The
IndexMapValuesMuttype is now inside theindex_mapmodule and has been renamed toValuesMut. - The
histbufmodule has been renamed tohistory_buf. - The
HistoryBuffertype has been renamed toHistoryBuf. - The
HistoryBufferViewtype has been renamed toHistoryBufView. - The
OwnedHistBufStoragetype has been renamed toOwnedHistoryBufStorage. - The
ViewHistBufStoragetype has been renamed toViewHistoryBufStorage. - The
MpMcQueuetype has been renamed toQueue. - The
MpMcQueueViewtype has been renamed toQueueView. - The
MpMcQueueInnertype has been renamed toQueueInner. - Remove
Q*type aliases forMpMcQueue, and rename it to justQueue - Changed
Queue::splitto beconst.
Fixed
- Fixed bug in
IndexMap::truncatethat left the map in an inconsistent state. - Fixed compilation on
thumbv6m-none-eabiwithoutportable-atomicfeature. - Fixed clippy lints.
- Fixed
{arc,box,object}_pool!emitting clippy lints. - Fixed the list of implemented data structures in the crate docs, by adding
Deque,HistoryBufferandSortedLinkedListto the list. - Fixed
MpMcQueuewithmpmc_largefeature. - Fix missing
DropforMpMcQueue
Removed
Vec::storage_capacityhas been removed andVec::capacitymust be used instead.- Removed
sorted_linked_list::Iterandsorted_linked_list::IterInner. - Removed
sorted_linked_list::FindMutandsorted_linked_list::FindMutInner. - The
Q2,Q4,Q8,Q16,Q32andQ64aliases forMpMcQueuehave been removed. doc_auto_cfgfeature which was merged intodoc_cfg. Presence of the feature led to doc build failures on nightly.
- Added
-
0.8.008 Nov 2023Release notes
Open source →Added
- Add
CloneandPartialEqimplementations toHistoryBuffer. - Added an object pool API. see the
pool::objectmodule level doc for details - Add
HistoryBuffer::as_slices() - Implemented
retainforIndexMapandIndexSet. - Recover
StableDereftrait forpool::object::Objectandpool::boxed::Box. - Add polyfills for ESP32S2
- Added
String::from_utf8andString::from_utf8_unchecked.
Changed
- updated from edition 2018 to edition 2021
- [breaking-change]
IndexMapandIndexSetnow require that keys implement thecore::hash::Hashtrait instead of thehash32::Hash(v0.2.0) trait - move
pool::singleton::Boxto thepool::boxmodule - renamed
pool::singleton::PooltoBoxPooland moved it into thepool::boxmodule - move
pool::singleton::arc::Arcto thepool::arcmodule - renamed
pool::singleton::arc::PooltoArcPooland moved it into thepool::arcmodule - [breaking-change] changed the target support of memory pool API to only support 32-bit x86 and a
subset of ARM targets. See the module level documentation of the
poolmodule for details - relax trait requirements on
IndexMapandIndexSet. - export
IndexSetandIndexMapiterator types. - [breaking-change] export
IndexMapKeys,IndexMapValuesandIndexMapValuesMutiterator types. - [breaking-change] this crate now uses
portable-atomicv1.0 instead ofatomic-polyfillfor emulating CAS instructions on targets where they're not natively available. - [breaking-change]
From<&str>forStringwas replaced withTryFrom<&str>because theFromtrait must not fail. - [breaking-change] Renamed Cargo features
defmt-implis nowdefmt-03ufmt-implis nowufmtcasis removed, atomic polyfilling is now opt-in via theportable-atomicfeature.
Vec::as_mut_sliceis now a public method.ufmtfunctions are annotated withinline.
Fixed
- Fixed a
dropping_referenceswarning inLinearMap. - Fixed IndexMap entry API returning wrong slot after an insert on vacant entry. (#360)
Removed
-
[breaking-change] this crate no longer has a Minimum Supported Rust Version (MSRV) guarantee and should be used with the latest stable version of the Rust toolchain.
-
[breaking-change] removed the
InitandUnininttype states frompool::singleton::Box -
[breaking-change] removed the following
pool::singleton::Boxmethods:freeze,forgetandinit -
[breaking-change] removed the
pool::singleton::arc::ArcInnertype -
[breaking-change] removed support for attributes from
pool!andarc_pool!
- Add
-
0.7.1704 Dec 2023Nothing published for this version
-
0.7.1609 Aug 2022Release notes
Open source →Added
- add more
PartialEqimplementations toVecwhereVecis the RHS
Changed
Fixed
- clarify in the docs that the capacity
heapless::Stringis in bytes, not characters - Fixed some broken links in the documentation.
- add more
-
0.7.1505 Jul 2022Release notes
Open source →Added
- Added
Vec::insert(index, element) - Added
Vec::remove(index) - Added
Vec::retain(f) - Added
Vec::retain_mut(f)
- Added
-
0.7.1415 Jun 2022Release notes
Open source →Added
- Added support for AVR architecture.
Fixed
IndexSetandIndexMap'sdefaultmethod now compile time checks that their capacity is a power of two.
-
0.7.1316 May 2022 -
0.7.1212 May 2022Release notes
Open source →Added
- Added support for AVR architecture.
- Add
entryAPI toIndexMap - Implement
IntoIteratortrait forIndexmap - Implement
FromIteratorforString - Add
firstandlastmethods toIndexMapandIndexSet - Add
pop_{front_back}_uncheckedmethods toDeque
Changed
- Optimize the codegen of
Vec::clone riscv32iandriscv32imctargets unconditionally (e.g.build --no-default-features) depends onatomic-polyfill
Fixed
- Inserting an item that replaces an already present item will no longer fail with an error
-
0.7.1109 May 2022Release notes
Open source →Fixed
- Fixed
poolexample in docstring. - Fixed undefined behavior in
Vec::truncate(),Vec::swap_remove_unchecked(), andHole::move_to()(internal to the binary heap implementation). - Fixed
BinaryHeapelements are being dropped twice
- Fixed
-
0.7.1021 Jan 2022Release notes
Open source →Fixed
cargo testcan now run on non-x86hosts
Added
- Added
OldestOrderediterator forHistoryBuffer
Changed
atomic-polyfillis now enabled and used forcasatomic emulation onriscvtargets
-
0.7.916 Dec 2021 -
0.7.811 Nov 2021 -
0.7.722 Sep 2021 -
0.7.621 Sep 2021Release notes
Open source →Added
- Added
ArcPool - Added
Debugimpl forDeque
Fixed
- ZSTs in
Poolnow works correctly - Some MIRI errors were resolved
- Allow
pool!on thumbv6 - Fixed possible UB in
Poolon x86
- Added
-
0.7.516 Aug 2021Release notes
Open source →Added
- Added
SortedLinkedList - Added
Vec::is_empty, one does not need to go through a slice anymore
Changed
Vec::pop_uncheckedis now public
- Added
-
0.7.406 Aug 2021Release notes
Open source →Added
- Implement
DefaultforMpMcQueue,QueueandHistoryBuffer - Implement
PartialOrdandOrdforVecandString
Fixed
- Fixed comments in SPSC
- Implement
-
0.7.301 Jul 2021Release notes
Open source →Added
- Added
Deque
Changed
Box::freezeis deprecated due to possibility of undefined behavior.
- Added
-
0.7.230 Jun 2021Release notes
Open source →Added
- Added new
Vec::into_arraymethod - Added const-asserts to all data structures
- Added new
-
0.7.123 May 2021 -
0.7.002 May 2021Release notes
Open source →Changed
- [breaking-change] Converted all data structures to use the
const genericsMVP - [breaking-change]
HistoryBufferis now working with const constructors and non-Copydata - [breaking-change]
HistoryBuffer::as_sliceand others now only return initialized values - Added missing
Deref,AsRefandDebugforHistoryBuffer - [breaking-change]
MultiCore/SingleCoreandUxxis now removed fromspsc::Queue - [breaking-change]
spsc::Queueis nowusizeonly - [breaking-change]
spsc::Queuenow sacrifices one element for correctness (see issue #207), i.e. it creates anN - 1sized queue instead of the old that generated an sizeNqueue - [breaking-change]
Stringhas hadutf8related methods removed as this can be done viastr - [breaking-change] No data structures implement
AsSlicetraits any more, now usingAsRefandAsMutas they work with any size of array now
Fixed
PoolandMPMCnow works onthumbv6mIndexMap::new()is now aconst-fn
- [breaking-change] Converted all data structures to use the
-
0.6.102 Mar 2021 -
0.6.003 Feb 2021Release notes
Open source →Changed
- [breaking-change] The version of the
generic-arraydependency has been bumped to v0.14.2.
- [breaking-change] The version of the
-
0.5.622 Sep 2020Release notes
Open source →Added
- Added
as_mut_vecforString - Added
set_lenforVec - Performance improvements in
histbuf
Fixed
Producerwas madeSendfor single core applications
- Added
-
0.5.504 May 2020Release notes
Open source →Added
- Added
HistoryBuffer - Added extra methods to
Vec:from_slice,starts_with,ends_with - Optional
ufmtsupport forStringandVec - Added
poolsupport for bare-metalarmebv7r-targets - Added Sync to
poolforx86
- Added
-
0.5.406 Apr 2020Release notes
Open source →Added
- Added
StableDerefimplementation forpool::Boxandpool::singleton::Box.
- Added
-
0.5.327 Jan 2020Release notes
Open source →Added
- Extend the ARMv7-A
Poolsupport to the bare-metalarmv7a-targets.
- Extend the ARMv7-A
-
0.5.215 Jan 2020Release notes
Open source →Fixed
- Fixed incorrect overflow behavior in computation of capacities
- Fixed edge case in
mpmc::Queue::dqueuethat led to an infinite loop - IndexMap and LinerMap are now deserialized as maps, rather than as sequences
- Fixed compilation of this crates on built-in targets that don't have CAS instructions
Changed
spsc::Queueiterators now implement the double ended iterator trait
Added
-
opt-out
casfeature to disable parts of the API that use CAS instructions. Useful if using a custom (i.e. not built-in) rustc target that does not have CAS instructions. -
singleton
Poolsupport on ARMv7-A devices
-
0.5.129 Aug 2019 -
0.5.011 Jul 2019Release notes
Open source →Added
-
Poolnow implements theSynctrait when targeting ARMv7-R. -
Most data structures can now be constructed in "const context" (e.g.
static [mut]variables) using a newtype inheapless::i. -
Poolhas gained agrow_exactmethod to more efficiently use statically allocated memory. -
The
pool!macro now accepts attributes. -
mpmc::Q*a family of fixed capacity multiple-producer multiple-consumer lock-free queues.
Changed
- [breaking-change]
binary_heap::Kindis now a sealed trait.
Removed
-
[breaking-change] The "smaller-atomics" feature has been removed. It is now always enabled.
-
[breaking-change] The "min-const-fn" feature has been removed. It is now always enabled.
-
[breaking-change] The MSRV has been bumped to Rust 1.36.0.
-
[breaking-change] The version of the
generic-arraydependency has been bumped to v0.13.0.
-
-
0.5.0-alpha.222 May 2019 pre-release withdrawnNothing published for this version
-
0.5.0-alpha.121 May 2019 pre-release withdrawnNothing published for this version
-
0.4.402 May 2019Release notes
Open source →Added
- Implemented
PartialEq,PartialOrd,Eq,OrdandHashforpool::Boxandpool::singleton::Box.
Fixed
- Fixed UB in our internal, stable re-implementation of
core::mem::MaybeUninitthat occurred when using some of our data structures with types that implementDrop.
- Implemented
-
0.4.322 Apr 2019Release notes
Open source →Added
-
Added a memory pool that's lock-free and interrupt-safe on the ARMv7-M architecture.
-
IndexMaphave gainedEqandPartialEqimplementations.
-
-
0.4.212 Feb 2019Release notes
Open source →Added
-
All containers now implement
Clone -
spsc::Queuenow implementsDebug,Hash,PartialEqandEq -
LinearMapnow implementsDebug,FromIterator,IntoIter,PartialEq,EqandDefault -
BinaryHeapnow implementsDebugandDefault -
Stringnow implementsFromStr,Hash,From<uxx>andDefault -
Vecnow implementsHashandDefault -
A "serde" Cargo feature that when enabled adds a
serde::Serializeandserde::Deserializeimplementations to each collection.
-
-
0.4.116 Dec 2018Release notes
Open source →Changed
- Add a new type parameter to
spsc::Queuethat indicates whether the queue is only single-core safe, or multi-core safe. By default the queue is multi-core safe; this preserves the current semantics. Newunsafeconstructors have been added to create the single-core variant.
- Add a new type parameter to
-
0.4.019 Oct 2018Release notes
Open source →Changed
-
[breaking-change] All Cargo features are disabled by default. This crate now compiles on stable by default.
-
[breaking-change] RingBuffer has been renamed to spsc::Queue. The ring_buffer module has been renamed to spsc.
-
[breaking-change] The bounds on spsc::Queue have changed.
Removed
- [breaking-change] The sealed
Uxxtrait has been removed from the public API.
-
-
0.3.719 Aug 2018Release notes
Open source →Added
- Implemented
IntoIteratorandFromIteratorforVec readymethods toring_buffer::{Consumer,Producer}- An opt-out "const-fn" Cargo feature that turns
constfunctions into normal functions when disabled. - An opt-out "smaller-atomics" Cargo feature that removes the ability to shrink the size of
RingBufferwhen disabled.
Changed
- This crate now compiles on stable when both the "const-fn" and "smaller-atomics" features are disabled.
Fixed
- The
RingBuffer.lenfunction - Compilation on recent nightlies
- Implemented
-
0.3.604 May 2018Release notes
Open source →Fixed
- The capacity of
RingBuffer. It should be the requested capacity plus not twice that plus one.
- The capacity of
-
0.3.503 May 2018Release notes
Open source →Added
RingBuffer.enqueue_uncheckedan unchecked version ofRingBuffer.enqueue
-
0.3.428 Apr 2018 -
0.3.328 Apr 2018 -
0.3.227 Apr 2018 -
0.3.123 Apr 2018Release notes
Open source →Added
- Fixed capacity implementations of
IndexMapandIndexSet. - A
Extendimplementation toVec - More
PartialEqimplementations toVec
- Fixed capacity implementations of
-
0.3.021 Apr 2018Release notes
Open source →Changed
-
[breaking-change] The capacity of all data structures must now be specified using type level integers (cf.
typenum). See documentation for details. -
[breaking-change]
BufferFullErrorhas been removed in favor of (a) returning ownership of the item that couldn't be added to the collection (cf.Vec.push), or (b) returning the unit type when the argument was not consumed (cf.Vec.extend_from_slice).
-
-
0.2.720 Apr 2018Release notes
Open source →Added
- Unchecked methods to dequeue and enqueue items into a
RingBuffervia theConsumerandProducerend points.
Changed
RingBuffernow has a generic index type, which default tousizefor backward compatibility. Changing the index type tou8oru16reduces the footprint of theRingBufferbut limits its maximum capacity (254 and 65534, respectively).
- Unchecked methods to dequeue and enqueue items into a
-
0.2.619 Apr 2018Release notes
Open source →Added
- A
BinaryHeapimplementation.BinaryHeapis a priority queue implemented with a binary heap.
- A
-
0.2.513 Apr 2018 -
0.2.412 Mar 2018 -
0.2.311 Mar 2018Release notes
Open source →Added
- A
swap_removemethod toVec - A
LinearMapimplementation.LinearMapis a map / dict backed by an array and that performs lookups via linear search.
- A
-
0.2.201 Mar 2018 -
0.2.121 Dec 2017Release notes
Open source →Added
-
Vecnow implements bothfmt::Debug,PartialEqandEq. -
resizeandresize_defaultmethods toVec.
-
-
0.2.022 Nov 2017Release notes
Open source →Added
-
A single producer single consumer mode to
RingBuffer. -
A
truncatemethod toVec.
Changed
-
[breaking-change] Both
Vec::newandRingBuffer::newno longer require an initial value. The signature ofnewis nowconst fn() -> Self. -
[breaking-change] The error type of all operations that may fail has changed from
()toBufferFullError. -
Both
RingBufferandVecnow support arrays of any size for their backup storage.
-
-
0.1.027 Apr 2017