Skip to main content

Utf8CharsEx

Trait Utf8CharsEx 

Source
pub trait Utf8CharsEx {
    // Required methods
    fn chars(&self) -> Utf8Chars<'_> ;
    fn char_indices(&self) -> Utf8CharIndices<'_> ;
}
Expand description

Convenience trait that adds chars() and char_indices() methods similar to the ones on string slices to byte slices.

Required Methods§

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Utf8CharsEx for [u8]

Source§

fn chars(&self) -> Utf8Chars<'_>

Convenience method for creating an UTF-8 iterator for the slice.

Source§

fn char_indices(&self) -> Utf8CharIndices<'_>

Convenience method for creating a byte index and UTF-8 iterator for the slice.

Implementors§