doc.rust-lang.org
pub const unsafe fn from_utf8_unchecked_mut(v: &mut [u8]) -> &mut str
Converts a slice of bytes to a string slice without checking that the string contains valid UTF-8; mutable version.
associated_function
core
Stable since 1.87.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn from_utf8_unchecked(v: &[u8]) -> &str
Converts a slice of bytes to a string slice without checking that the string contains valid UTF-8.
associated_function
core
Stable since 1.87.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn from_utf8_mut(v: &mut [u8]) -> Result<&mut str, Utf8Error>
Converts a mutable slice of bytes to a mutable string slice.
associated_function
core
Stable since 1.87.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn from_utf8(v: &[u8]) -> Result<&str, Utf8Error>
Converts a slice of bytes to a string slice.
associated_function
core
Stable since 1.87.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn floor_char_boundary(&self, index: usize) -> usize
Finds the closest x not exceeding index where is_char_boundary(x) is true.
method
core
Stable since 1.91.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn find<P>(&self, pat: P) -> Option<usize>
Returns the byte index of the first character of this string slice that matches the pattern.
method
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn escape_unicode(&self) -> EscapeUnicode<'_>
Returns an iterator that escapes each char in self with char::escape_unicode.
method
core
Stable since 1.34.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn escape_default(&self) -> EscapeDefault<'_>
Returns an iterator that escapes each char in self with char::escape_default.
method
core
Stable since 1.34.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn escape_debug(&self) -> EscapeDebug<'_>
Returns an iterator that escapes each char in self with char::escape_debug.
method
core
Stable since 1.34.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn valid_up_to(&self) -> usize
Returns the index in the given string up to which valid UTF-8 was verified.
method
core
Stable since 1.5.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn error_len(&self) -> Option<usize>
Provides more information about the failure:
method
core
Stable since 1.20.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct Utf8Error
Errors which can occur when attempting to interpret a sequence of u8 as a string.
struct
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct ParseBoolError
An error returned when parsing a bool using from_str fails
struct
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn eq_ignore_ascii_case(&self, other: &str) -> bool
Checks that two strings are an ASCII case-insensitive match.
method
core
Stable since 1.23.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn ends_with<P>(&self, pat: P) -> bool
Returns true if the given pattern matches a suffix of this string slice.
method
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn encode_utf16(&self) -> EncodeUtf16<'_>
Returns an iterator of u16 over the string encoded as native endian UTF-16 (without byte-order mark).
method
core
Stable since 1.8.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn from_utf8_unchecked_mut(v: &mut [u8]) -> &mut str
Converts a slice of bytes to a string slice without checking that the string contains valid UTF-8; mutable version.
function
core
Stable since 1.20.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn from_utf8_unchecked(v: &[u8]) -> &str
Converts a slice of bytes to a string slice without checking that the string contains valid UTF-8.
function
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn from_utf8_mut(v: &mut [u8]) -> Result<&mut str, super::Utf8Error>
Converts a mutable slice of bytes to a mutable string slice.
function
core
Stable since 1.20.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn from_utf8(v: &[u8]) -> Result<&str, super::Utf8Error>
Converts a slice of bytes to a string slice.
function
core
Stable since 1.0.0
Version 1.100.0-nightly