Expand description
Fixed-capacity containers re-exported from heapless.
These containers compile in both heap and zeroheap modes because their
capacity is a const generic and their storage is owned in the type — no
global allocator is ever consulted. Use them for general-purpose
collections (resizable vectors, fixed strings, hashmaps, deques) that
complement the RTOS-aware primitives (ove::Queue, ove::Stream).
use ove::containers::{Vec, String};
use ove::containers::ContainerExt;
let mut buf: Vec<u8, 64> = Vec::new();
let _ = buf.ove_push(0xAB); // Result<(), ove::Error>
let mut name: String<32> = String::new();
let _ = name.push_str("hello");§Choosing between ove::heap::Vec and ove::containers::Vec
-
crate::heap::Vec(re-exported fromalloc::vec::Vec) is a growable vector backed by the global allocator. Available only when thealloc(orstd) feature is enabled and a#[global_allocator]is registered. Cannot be used in zeroheap mode. -
Vec<T, N>from this module is fixed-capacity; capacity is a const generic and storage lives inline in the type. Always available, in both heap and zeroheap modes. Fallible:pushreturnsResult<(), T>; theContainerExt::ove_pushadapter converts that intocrate::Error::NoMemoryfor consistency with the rest of the binding’s error type.
§What is intentionally not re-exported
heapless::spsc::Queueandheapless::mpmc::Q*overlap semantically withcrate::Queue(the kernel-aware FIFO). Apps that explicitly want a lock-free SPSC ring should reach intoheapless::spscdirectly — the extra import documents the intent.
Modules§
- binary_
heap - A priority queue implemented with a binary heap.
- sorted_
linked_ list - A fixed sorted priority linked list, similar to
BinaryHeapbut with different properties onpush,pop, etc.
Structs§
Traits§
- Container
Ext - Adapter trait that maps a
heaplesscontainer’s capacity-overflow return into ancrate::Error::NoMemory. Use theove_*methods when you want the result to flow through the same?chain as otherove::Resultcalls.
Functions§
- ove_
push_ str - Append a string slice to a fixed-capacity
String, returningcrate::Error::NoMemorywhen the buffer is full.