small_str

Crates.iosmall_str
lib.rssmall_str
version0.1.0
sourcesrc
created_at2024-04-22 07:21:07.575758
updated_at2024-04-22 07:21:07.575758
descriptionA String-like but using SmallVec internally
homepage
repositoryhttps://github.com/juzi5201314/small_str
max_upload_size
id1216021
size58,458
orange soeur (juzi5201314)

documentation

README

SmallStr

Crates.io API reference

A String-like but using SmallVec internally

  • SmallStr<N> == SmallVec<u8, N>
  • Clone is O(n)
  • Strings smaller than N bytes are allocated on the stack.
  • SmallString is an alias for SmallStr<16> and size_of::<SmallString>() == size_of::<String>() on 64-bit platform

Macro

macro format_smallstr! like format!

Traits

ToSmallStr like ToString, convert T: Display to SmallStr

pub trait ToSmallStr {
    fn to_smallstr<const N: usize>(&self) -> SmallStr<N>;
}
Commit count: 10

cargo fmt