[][src]Crate string

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

StableAsRef

Marker trait that indicates that a type is guaranteed safe to use as backing storage for String.

TryFrom

Attempt to construct Self via a conversion.