mirror of
https://github.com/rust-embedded/heapless.git
synced 2025-09-29 21:40:27 +00:00
![bors[bot]](/assets/img/avatar_default.png)
170: Buffer methods for Vec and as_mut_vec for String r=japaric a=samlich This adds `set_len` to `Vec`, identical to the `std` version, with the documentation copied from `std`. This is useful for using it as a buffer by writing to the uninitialized portion and then setting the length to include those bytes. It also adds `as_mut_vec` to `String` (also from `std`), which enables using `String` as a buffer in the same manner. Co-authored-by: samlich <1349989+samlich@users.noreply.github.com>
heapless
static
friendly data structures that don't require dynamic memory allocation
Documentation
Change log
Tests
# run all
cargo test --features 'serde','x86-sync-pool'
# run only for example histbuf tests
cargo test histbuf --features 'serde','x86-sync-pool'
License
Licensed under either of
-
Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
-
MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Description
Languages
Rust
100%