コンテンツにスキップ

heapless — Crate 詳細

heapless

Mature no_std

ヒープ無し(固定容量)で使えるコレクション(Vec/String/Deque/Map 等)を提供する crate。no_std 環境でのメモリ使用量を静的に制御しやすい。

Heapless, fixed-capacity data structures for no_std environments.

バージョン
0.8.0
ライセンス
MIT OR Apache-2.0
メンテナンス
活発に開発中

コード例

容量が型に埋め込まれるため、最大メモリ量を把握しやすいです。

固定容量 Vec の利用
#![no_std]
use heapless::Vec;
pub fn push_values() {
let mut v: Vec<u8, 8> = Vec::new();
let _ = v.push(1);
let _ = v.push(2);
}

関連 Crates

関連記事