#inline #string #no-std #allocation

no-std istring

A replacement for String that allows storing short strings of length up to sizeof<String>() - 1 without a heap allocation

23 releases

0.4.2 Jan 13, 2025
0.4.1 Nov 18, 2024
0.4.0 Sep 26, 2024
0.3.4 Aug 30, 2023
0.1.5 Jul 23, 2017

#333 in Rust patterns

Download history 3632/week @ 2025-01-23 3929/week @ 2025-01-30 5024/week @ 2025-02-06 3871/week @ 2025-02-13 5098/week @ 2025-02-20 6149/week @ 2025-02-27 4242/week @ 2025-03-06 4208/week @ 2025-03-13 4907/week @ 2025-03-20 4557/week @ 2025-03-27 3747/week @ 2025-04-03 5762/week @ 2025-04-10 4991/week @ 2025-04-17 4905/week @ 2025-04-24 3887/week @ 2025-05-01 3069/week @ 2025-05-08

17,679 downloads per month
Used in 9 crates (via pdf)

MIT license

46KB
1.5K SLoC

A replacement for String that allows storing strings of length up to sizeof() - 1 without a heap allocation

That means on 32bit machines: size_of::() == 12 bytes, inline capacity: 11 bytes on 64bit machines: size_of::() == 24 bytes, inline capacity: 23 bytes

Dependencies

~0–435KB