Crate generic_str

Source
Expand description

The one and only string type in Rust

let foo: &str = "foo".into();
let expected: &str = "foobar".into();

let mut foobar = foo.to_owned();
foobar.push_str("bar".into());

assert_eq!(foobar, *expected);

Structs§

FromUtf8Error
StringBase

Functions§

from_utf8
Converts a slice of bytes to a string slice.
from_utf8_mut
Converts a mutable slice of bytes to a mutable string slice.
from_utf8_unchecked
Converts a slice of bytes to a string slice without checking that the string contains valid UTF-8.
from_utf8_unchecked_mut
Converts a slice of bytes to a string slice without checking that the string contains valid UTF-8.

Type Aliases§

ArrayString
Same API as String but without any re-allocation. Can only hold up to N bytes
ArrayString32
UTF-32 Owned String that has a fixed capacity
OwnedString
String
Exactly the same as std::string::String, except generic
String32
UTF-32 Owned String that supports reallocation
StringSlice
str
Exactly the same as std::primitive::str, except generic
str32
Exactly the same as std::str, except generic