Crate string[−][src]
A UTF-8 encoded string with configurable byte storage.
This crate provides String
, a type similar to its std counterpart, but
with one significant difference: the underlying byte storage is
configurable. In other words, String<T>
is a marker type wrapping T
,
indicating that it represents a UTF-8 encoded string.
For example, one can represent small strings (stack allocated) by wrapping an array:
let s: String<[u8; 2]> = String::try_from([b'h', b'i']).unwrap(); assert_eq!(&s[..], "hi");
Structs
String |
A UTF-8 encoded string with configurable byte storage. |
Traits
TryFrom |
Attempt to construct |