#string #inline #allocation #no-std

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

#297 in Rust patterns

Download history 2879/week @ 2024-12-17 867/week @ 2024-12-24 1983/week @ 2024-12-31 3314/week @ 2025-01-07 3488/week @ 2025-01-14 4673/week @ 2025-01-21 3004/week @ 2025-01-28 4866/week @ 2025-02-04 4431/week @ 2025-02-11 3389/week @ 2025-02-18 7209/week @ 2025-02-25 4599/week @ 2025-03-04 4210/week @ 2025-03-11 4251/week @ 2025-03-18 5136/week @ 2025-03-25 3662/week @ 2025-04-01

18,060 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–430KB