#[repr(transparent)]pub struct Utf8Str(_);Expand description
UTF-8 string slice.
This type supports efficient conversion to and from the str type. It is provided
primarily for consistency with the other string types.
Implementations
sourceimpl Utf8Str
impl Utf8Str
sourcepub fn as_str(&self) -> &str
pub fn as_str(&self) -> &str
Access this data as a str.
This view is possible because the str type represents a UTF-8 encoded
sequence of bytes, just as Utf8 does.
sourcepub unsafe fn from_utf8_unchecked(utf8: &[u8]) -> &Utf8Str
pub unsafe fn from_utf8_unchecked(utf8: &[u8]) -> &Utf8Str
Converts a slice of bytes to a Utf8 without validating that the slice
contains valid UTF-8 encoded data.