Struct encode_unicode::iterator::Utf8CharIndices[][src]

pub struct Utf8CharIndices<'a> { /* fields omitted */ }

An iterator over the Utf8Char of a string slice, and their positions.

This struct is created by the utf8char_indices() method from [StrExt`] trait. See its documentation for more.

Implementations

impl<'a> Utf8CharIndices<'a>[src]

pub fn as_str(&self) -> &'a str[src]

Extract the remainder of the source str.

Examples

use encode_unicode::{StrExt, Utf8Char};
let mut iter = "abc".utf8char_indices();
assert_eq!(iter.next_back(), Some((2, Utf8Char::from('c'))));
assert_eq!(iter.next(), Some((0, Utf8Char::from('a'))));
assert_eq!(iter.as_str(), "b");

Trait Implementations

impl<'a> Clone for Utf8CharIndices<'a>[src]

impl<'a> Debug for Utf8CharIndices<'a>[src]

impl<'a> DoubleEndedIterator for Utf8CharIndices<'a>[src]

impl<'a> From<&'a str> for Utf8CharIndices<'a>[src]

impl<'a> Iterator for Utf8CharIndices<'a>[src]

type Item = (usize, Utf8Char)

The type of the elements being iterated over.

Auto Trait Implementations

impl<'a> RefUnwindSafe for Utf8CharIndices<'a>

impl<'a> Send for Utf8CharIndices<'a>

impl<'a> Sync for Utf8CharIndices<'a>

impl<'a> Unpin for Utf8CharIndices<'a>

impl<'a> UnwindSafe for Utf8CharIndices<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.