heapless/Cargo.toml
Zeeshan Ali Khan 0b027b1ff8 Implements zeroization support across all heapless data structures to securely clear sensitive data from memory:
- When the zeroize feature is enabled, the LenType sealed trait now has Zeroize as a supertrait
- This simplifies the bound for deriving Zeroize for VecInner and other types
- Added tests to verify VecView also implements Zeroize correctly

This feature is essential for security-sensitive applications needing to prevent data leaks from memory dumps.

Note: Zeroize initially worked on Vector purely via derivation, however was not complete without proper bound checks. Without these checks, the deref implementation of Zeroize was used instead, which led to incomplete zeroization of the Vector's contents.
2025-09-24 13:06:10 -04:00

92 lines
2.7 KiB
TOML

[package]
authors = [
"Jorge Aparicio <jorge@japaric.io>",
"Per Lindgren <per.lindgren@ltu.se>",
"Emil Fresk <emil.fresk@gmail.com>",
]
categories = ["data-structures", "no-std"]
description = "`static` friendly data structures that don't require dynamic memory allocation"
documentation = "https://docs.rs/heapless"
edition = "2021"
rust-version = "1.87"
keywords = ["static", "no-heap"]
license = "MIT OR Apache-2.0"
name = "heapless"
repository = "https://github.com/rust-embedded/heapless"
version = "0.9.1"
[features]
bytes = ["dep:bytes"]
# Enable polyfilling of atomics via `portable-atomic`.
# `portable-atomic` polyfills some functionality by default, but to get full atomics you must
# enable one of its features to tell it how to do it. See `portable-atomic` documentation for details.
portable-atomic = ["dep:portable-atomic"]
# Enable polyfilling of atomics via portable-atomic, using critical section for locking
portable-atomic-critical-section = [
"dep:portable-atomic",
"portable-atomic",
"portable-atomic?/critical-section",
]
# Enable polyfilling of atomics via portable-atomic, using disabling interrupts for locking.
# WARNING: this is only sound for single-core bare-metal privileged-mode targets!
portable-atomic-unsafe-assume-single-core = [
"dep:portable-atomic",
"portable-atomic",
"portable-atomic?/unsafe-assume-single-core",
]
# implement serde traits.
serde = ["dep:serde_core"]
# implement ufmt traits.
ufmt = ["dep:ufmt", "dep:ufmt-write"]
# Implement `defmt::Format`.
defmt = ["dep:defmt"]
# Implement `zeroize::Zeroize` trait.
zeroize = ["dep:zeroize"]
# Enable larger MPMC sizes.
mpmc_large = []
# Implement some alloc Vec interoperability
alloc = []
nightly = []
[dependencies]
bytes = { version = "1", default-features = false, optional = true }
portable-atomic = { version = "1.0", optional = true }
hash32 = "0.3.0"
serde_core = { version = "1", optional = true, default-features = false }
ufmt = { version = "0.2", optional = true }
ufmt-write = { version = "0.1", optional = true }
defmt = { version = "1.0.1", optional = true }
zeroize = { version = "1.8", optional = true, default-features = false, features = ["derive"] }
# for the pool module
[target.'cfg(any(target_arch = "arm", target_pointer_width = "32", target_pointer_width = "64"))'.dependencies]
stable_deref_trait = { version = "1", default-features = false }
[dev-dependencies]
critical-section = { version = "1.1", features = ["std"] }
static_assertions = "1.1.0"
[package.metadata.docs.rs]
features = [
"bytes",
"ufmt",
"serde",
"defmt",
"mpmc_large",
"portable-atomic-critical-section",
"alloc",
]
# for the pool module
targets = ["i686-unknown-linux-gnu"]
rustdoc-args = ["--cfg", "docsrs"]