Expand description
§char_str
Compact owned strings with mutable and immutable variants.
char_str is a fork of lean_string with
customizations for use in Ruff and
ty.
use char_str::{CharStr, format_char_str};
let module = "mod";
let name = format_char_str!("pkg.{module}");
assert_eq!(name, "pkg.mod");
assert!(name.len() <= CharStr::INLINE_CAPACITY);§License
This crate is licensed under the MIT license.
Macros§
- format_
char - Formats text into a
CharString. - format_
char_ str - Formats text into an immutable
CharStr.
Structs§
- CharStr
- Compact, immutable, UTF-8 encoded owned string type.
- Char
String - Compact, clone-on-write, UTF-8 encoded, growable string type.
- From
Utf16 Error - An error if the conversion from a sequence of UTF-16 code units to a
CharStringfails due to invalid UTF-16 code unit sequences. - Reserve
Error - An error if allocating or resizing a
CharStringfailed.
Enums§
- ToChar
String Error - An error that can occur when converting a value to a
CharString.
Traits§
- ToChar
String - A trait for converting a value to a
CharString.