Expand description
§smol_buf
The smol_buf crate offers the following types, each offering inline stack-allocated storage,
and falling back to heap-allocation otherwise.
| ty | Deref Target | size_of::<T> | size_of::<Option<T>> | inline bytes | Clone |
|---|---|---|---|---|---|
Str24 | &str | 24 | 24 | 23 | O(1) |
Str16 | &str | 16 | 16 | 15 | O(1) |
Buf24 | &[u8] | 24 | 24 | 23 | O(1) |
Buf16 | &[u8] | 16 | 16 | 15 | O(1) |
Unlike String and Vec, however, the types are immutable.
They are thus replacements for Arc<str> and Arc<[u8]> respectively.
§MSRV Policy
Minimal Supported Rust Version: latest stable.
Bumping MSRV is not considered a semver-breaking change.
§Feature flags
arbitrary— Adds support to create random strings usingarbitrary.serde— Adds serialization and deserialization support viaserde.intern— Enables a simple interner for strings.
Structs§
- Buf16
- A small-data optimized byte buffer.
- Buf24
- A small-data optimized byte buffer.
- Intern16
intern Intern16is an interner storing and yieldingStr16string types.- Intern24
intern Intern24is an interner storing and yieldingStr24string types.- Str16
- A
Str16is a string type that has the following properties: - Str24
- A
Str24is a string type that has the following properties: