Struct GraphemeIndices

struct GraphemeIndices<'a> { ... }

External iterator for grapheme clusters and byte offsets.

This struct is created by the grapheme_indices method on the UnicodeSegmentation trait. See its documentation for more.

Implementations

impl<'a> GraphemeIndices<'a>

fn as_str(self: &Self) -> &'a str

View the underlying data (the part yet to be iterated) as a slice of the original string.

# use unicode_segmentation::UnicodeSegmentation;
let mut iter = "abc".grapheme_indices(true);
assert_eq!(iter.as_str(), "abc");
iter.next();
assert_eq!(iter.as_str(), "bc");
iter.next();
iter.next();
assert_eq!(iter.as_str(), "");

impl<'a> Clone for GraphemeIndices<'a>

fn clone(self: &Self) -> GraphemeIndices<'a>

impl<'a> Debug for GraphemeIndices<'a>

fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result

impl<'a> DoubleEndedIterator for GraphemeIndices<'a>

fn next_back(self: &mut Self) -> Option<(usize, &'a str)>

impl<'a> Freeze for GraphemeIndices<'a>

impl<'a> Iterator for GraphemeIndices<'a>

fn next(self: &mut Self) -> Option<(usize, &'a str)>
fn size_hint(self: &Self) -> (usize, Option<usize>)

impl<'a> RefUnwindSafe for GraphemeIndices<'a>

impl<'a> Send for GraphemeIndices<'a>

impl<'a> Sync for GraphemeIndices<'a>

impl<'a> Unpin for GraphemeIndices<'a>

impl<'a> UnsafeUnpin for GraphemeIndices<'a>

impl<'a> UnwindSafe for GraphemeIndices<'a>

impl<I> IntoIterator for GraphemeIndices<'a>

fn into_iter(self: Self) -> I

impl<T> Any for GraphemeIndices<'a>

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for GraphemeIndices<'a>

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for GraphemeIndices<'a>

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> CloneToUninit for GraphemeIndices<'a>

unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)

impl<T> From for GraphemeIndices<'a>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T, U> Into for GraphemeIndices<'a>

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for GraphemeIndices<'a>

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for GraphemeIndices<'a>

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>