7 releases
Uses new Rust 2024
| 0.4.3 | Mar 23, 2026 |
|---|---|
| 0.4.2 | Mar 23, 2026 |
| 0.3.0 | Mar 23, 2026 |
| 0.2.1 | Mar 23, 2026 |
#2395 in Rust patterns
27KB
587 lines
combined_str
A no_std Rust library providing CombinedStr, a zero-copy, const-generic string combinator that holds N string slices and presents them as a single logical string — without allocating.
Features
no_stdcompatible — works in embedded and bare-metal environments- Zero-copy — holds
&strreferences, no heap allocation required allocfeature — enables conversion toStringandCow<str>, plus+=/+operators and equality comparisonsDisplay— prints all segments as one contiguous string- Iterator — iterate over the individual
&strsegments
Usage
[dependencies]
combined_str = "0.4"
use combined_str::strs;
let s = strs!["hello", ", ", "world"];
println!("{}", s); // hello, world
assert_eq!(s.len(), 12);
Feature flags
| Flag | Default | Description |
|---|---|---|
alloc |
enabled | Enables String/Cow support via the alloc crate |
nightly |
disabled | Enables generic_const_exprs for CombinedStr<N> + CombinedStr<M> and CombinedStr<N> + &str |
License
MIT