Crates.io | small_str |
lib.rs | small_str |
version | 0.1.0 |
source | src |
created_at | 2024-04-22 07:21:07.575758 |
updated_at | 2024-04-22 07:21:07.575758 |
description | A String-like but using SmallVec internally |
homepage | |
repository | https://github.com/juzi5201314/small_str |
max_upload_size | |
id | 1216021 |
size | 58,458 |
A String
-like but using SmallVec
internally
SmallStr<N>
== SmallVec<u8, N>
Clone
is O(n)
N
bytes are allocated on the stack.SmallString
is an alias for SmallStr<16>
and size_of::<SmallString>() == size_of::<String>()
on 64-bit platformmacro format_smallstr!
like format!
ToSmallStr
like ToString
, convert T: Display
to SmallStr
pub trait ToSmallStr {
fn to_smallstr<const N: usize>(&self) -> SmallStr<N>;
}