Skip to main content

sigma_bounded/
lib.rs

1//! Bounded [`Vec`], [`String`], and [`BTreeMap`] for `alloc` or [`heapless`].
2//!
3//! Part of the Sigma **`dbc-rs`** **embedded-first** story: pick **`alloc`** (default) or
4//! **`heapless`** (`default-features = false`) so firmware policy matches **`dbc-rs`** without
5//! duplicating collection wrappers elsewhere.
6
7#![cfg_attr(not(feature = "alloc"), no_std)]
8#![forbid(unsafe_code)]
9
10#[cfg(all(not(feature = "alloc"), not(feature = "heapless")))]
11compile_error!("Either the `alloc` or `heapless` feature must be enabled");
12
13#[cfg(feature = "alloc")]
14extern crate alloc;
15
16mod btree_map;
17pub mod error;
18mod string;
19mod vec;
20
21pub use btree_map::BTreeMap;
22pub use error::{Error, Result};
23pub use string::String;
24pub use vec::Vec;