Crate smol_buf

Crate smol_buf 

Source
Expand description

§smol_buf

CI Crates.io API reference

The smol_buf crate offers the following types, each offering inline stack-allocated storage, and falling back to heap-allocation otherwise.

tyDeref Targetsize_of::<T>size_of::<Option<T>>inline bytesClone
Str24&str242423O(1)
Str16&str161615O(1)
Buf24&[u8]242423O(1)
Buf16&[u8]161615O(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 using arbitrary.
  • serde — Adds serialization and deserialization support via serde.
  • intern — Enables a simple interner for strings.

Structs§

Buf16
A small-data optimized byte buffer.
Buf24
A small-data optimized byte buffer.
Intern16intern
Intern16 is an interner storing and yielding Str16 string types.
Intern24intern
Intern24 is an interner storing and yielding Str24 string types.
Str16
A Str16 is a string type that has the following properties:
Str24
A Str24 is a string type that has the following properties: