stack_buf/lib.rs
1//! Vector-like facade for arrays allocated entirely on the stack.
2//!
3//! Shallow wrapper around an underlying `[T; N]`, which panics if the
4//! array bounds are exceeded.
5//!
6//! ## Optional features
7//!
8//! ### `std`
9//!
10//! Enabled by default. Use std library; disable to use `no_std` instead.
11//!
12//! ### `str`
13//!
14//! When this optional dependency is enabled, `StackStr` is available.
15//!
16//! ### `serde`
17//!
18//! When this optional dependency is enabled, `StackVec` and `StackStr` implement the `serde::Serialize` and
19//! `serde::Deserialize` traits.
20//!
21//! ## Rust Version
22//!
23//! This version of `stack-buf` requires Rust 1.51 or later.
24
25#![cfg_attr(not(feature = "std"), no_std)]
26#![cfg_attr(docsrs, feature(doc_cfg))]
27
28#[cfg(not(feature = "std"))]
29extern crate core as std;
30
31mod vec;
32
33pub use crate::vec::{Drain, IntoIter, StackVec};
34
35#[cfg(feature = "str")]
36mod str;
37
38#[cfg(feature = "str")]
39pub use crate::str::{FromUtf8Error, StackStr};