| Crates.io | qstr |
| lib.rs | qstr |
| version | 0.2.0 |
| created_at | 2025-11-10 09:17:06.443422+00 |
| updated_at | 2025-12-01 15:42:17.73612+00 |
| description | Cache-efficient, stack-allocated string types |
| homepage | |
| repository | https://github.com/tindzk/qstr |
| max_upload_size | |
| id | 1925002 |
| size | 54,675 |
qstr is a small, no_std Rust library providing cache-efficient, stack-allocated string types.
It is suitable for embedded environments, WebAssembly, parsers and other peformance-sensitive contexts.
In many cases, string lengths are bounded and their maximum size is known in advance. Storing such strings on the stack eliminates allocator overhead and improves cache locality.
Because qstr types implement Copy, they can be passed by value without cloning.
This library provides types for common sizes, optimised for cache-line efficiency.
Copyconst contextsserde supportno_std compatibleuse qstr::BStr15;
use qstr::StrVec;
use qstr::Align16;
let str: BStr15 = "aws:us:east:1".into();
let vec: StrVec<u16, 15, Align16> = str.split(":");
assert_eq!(
vec.iter().collect::<Vec<_>>(),
vec!["aws", "us", "east", "1"]
);
qstr is licensed under the terms of the Apache License, Version 2.0.