Trait encode_unicode::StrExt
source · [−]pub trait StrExt: AsRef<str> {
fn utf8chars(&self) -> Utf8Chars<'_>ⓘNotable traits for Utf8Chars<'a>impl<'a> Iterator for Utf8Chars<'a> type Item = Utf8Char;
;
fn utf16chars(&self) -> Utf16Chars<'_>ⓘNotable traits for Utf16Chars<'a>impl<'a> Iterator for Utf16Chars<'a> type Item = Utf16Char;
;
fn utf8char_indices(&self) -> Utf8CharIndices<'_>ⓘNotable traits for Utf8CharIndices<'a>impl<'a> Iterator for Utf8CharIndices<'a> type Item = (usize, Utf8Char);
;
fn utf16char_indices(&self) -> Utf16CharIndices<'_>ⓘNotable traits for Utf16CharIndices<'a>impl<'a> Iterator for Utf16CharIndices<'a> type Item = (usize, Utf16Char);
;
}
Expand description
Adds .utf8chars()
and .utf16chars()
iterator constructors to &str
.
Required Methods
Equivalent to .chars()
but produces Utf8Char
s.
fn utf16chars(&self) -> Utf16Chars<'_>ⓘNotable traits for Utf16Chars<'a>impl<'a> Iterator for Utf16Chars<'a> type Item = Utf16Char;
fn utf16chars(&self) -> Utf16Chars<'_>ⓘNotable traits for Utf16Chars<'a>impl<'a> Iterator for Utf16Chars<'a> type Item = Utf16Char;
Equivalent to .chars()
but produces Utf16Char
s.
fn utf8char_indices(&self) -> Utf8CharIndices<'_>ⓘNotable traits for Utf8CharIndices<'a>impl<'a> Iterator for Utf8CharIndices<'a> type Item = (usize, Utf8Char);
fn utf8char_indices(&self) -> Utf8CharIndices<'_>ⓘNotable traits for Utf8CharIndices<'a>impl<'a> Iterator for Utf8CharIndices<'a> type Item = (usize, Utf8Char);
Equivalent to .char_indices()
but produces Utf8Char
s.
fn utf16char_indices(&self) -> Utf16CharIndices<'_>ⓘNotable traits for Utf16CharIndices<'a>impl<'a> Iterator for Utf16CharIndices<'a> type Item = (usize, Utf16Char);
fn utf16char_indices(&self) -> Utf16CharIndices<'_>ⓘNotable traits for Utf16CharIndices<'a>impl<'a> Iterator for Utf16CharIndices<'a> type Item = (usize, Utf16Char);
Equivalent to .char_indices()
but produces Utf16Char
s.