1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//! `smart-string` is a collection of small string primitives:
//!
//! - [`PascalString`]: fixed-capacity UTF-8 string stored inline (stack / in-place).
//! - [`SmartString`]: stack-or-heap string that promotes to heap when needed.
//! - [`StrStack`]: mutable builder for a compact list of string segments in a single byte buffer.
//! - [`StrList`]: frozen (immutable) string list with no excess capacity.
//! - [`StrListRef`]: borrowed read-only view over string list data (zero-copy).
//!
//! ## Notes
//!
//! - `SmartString` promotion (stack → heap) can happen implicitly during mutation when capacity is exceeded.
//! - Demotion (heap → stack) is **explicit** and must be requested via [`SmartString::try_into_stack`].
//!
//! ## Safety & invariants
//!
//! This crate contains a small amount of `unsafe` code used to project internal UTF‑8 byte buffers as `&str` / `&mut str`
//! without repeated validation and bounds checks.
//!
//! Soundness relies on internal invariants:
//!
//! - `PascalString`: `len <= CAPACITY` and `data[..len]` is always valid UTF‑8.
//! - `StrStack`: `data` is always valid UTF‑8 and `ends` stores valid UTF‑8 segment boundaries within `data`.
//!
//! See also: `docs/parity.api.md` for the “std `String` parity” checklist and compatibility notes.
//! - MSRV (default features): **Rust 1.59.0**.
//! - Motivation: `SmartString`'s public API uses a default const generic parameter
//! (`SmartString<const N: usize = DEFAULT_CAPACITY>`), which requires newer compilers.
//! - Note: MSRV is a `rustc` guarantee for this crate. Without a committed `Cargo.lock`, transitive dependency MSRVs
//! can drift over time; our CI runs an MSRV job to detect such drift.
pub use crateDisplayExt;
pub use cratePascalString;
pub use crateIntoChars;
pub use crateSmartString;
pub use crateUtf16DecodeError;
pub use crateCheckpoint;
pub use crateStrList;
pub use crateStrListIter;
pub use crateStrListRef;
pub use crateStrListValidationError;
pub use crateStrStack;
pub use crateStrStackIter;
pub use crateStrStackOverflow;