Skip to main content

Crate char_str

Crate char_str 

Source
Expand description

§char_str

Crates.io Documentation

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.
CharString
Compact, clone-on-write, UTF-8 encoded, growable string type.
FromUtf16Error
An error if the conversion from a sequence of UTF-16 code units to a CharString fails due to invalid UTF-16 code unit sequences.
ReserveError
An error if allocating or resizing a CharString failed.

Enums§

ToCharStringError
An error that can occur when converting a value to a CharString.

Traits§

ToCharString
A trait for converting a value to a CharString.