heapless
heapless copied to clipboard
Heapless, `static` friendly data structures
Currently to insert in the `LinearMap` and get a mutable reference to the corresponding value (`map.entry(key).or_insert_with(...)`), it's necessary to `.insert()` then `.get().unwrap()`, because there is no entry API or assimilated....
These methods are equivalent to their `std` counterparts (except `swap_unchecked()`, which is a natural extension).
These operations, let's call them `from_parts` / `into_parts`, I believe would be quite useful to allow the payload to change owners/container types without moving the data. I don't think `into_array()`...
Currently, `Vec` always uses `usize` for the length field, which leads to silly situations like `Vec` being `8` bytes large on 32 bit platforms. This PR introduces a generic to...
### Motivation Currently, `heapless::String` takes 48 bytes and `Option` takes 56 bytes on 64-bit target platforms. We could save up to 14 / 21 bytes respectively and remove the `align(8)`...
The old bounds were unnecessarily strict. This PR relaxes the `V: Eq` bound to `V: PartialEq`.
`MpMc` and `spsc::Queue` are not migrated to the new pattern because they were already invariant due to the `UnsafeCell`. Fix #501
The following compiles with `v0.8.0` and https://github.com/rust-embedded/heapless/pull/425, but not with latest main: ```rust fn test_variance) -> Vec
This makes `drain` usable in the context of an implementation generic over the storage This also makes it possible to get a `*View` in this same context This could also...
I can compile my application (thumbv7em-none-eabihf) directly against heapless and it works fine. But in this case I have a library (e.g. device driver) that depends on heapless and it...