Skip to main content

typed_ident/syntax/segmentation/
segmentation.rs

1// =============================================================================
2// USES
3// =============================================================================
4
5// -----------------------------------------------------------------------------
6use crate::syntax::segmentation::{GraphemeIndicesIterator, GraphemesIterator};
7
8// =============================================================================
9// TRAITS
10// =============================================================================
11
12/// A trait which contains type definitions for segmentation iterators.
13pub trait Segmentation {
14    /// The kind of iterator to use for segmentation where you only need the
15    /// individual "graphemes" (or grapheme-equivalents).
16    type Graphemes<'a>: GraphemesIterator<'a>;
17
18    /// Same as `Graphemes`, except that it additionally will contain byte
19    /// offset information (`(usize, &str)`).
20    type GraphemeIndices<'a>: GraphemeIndicesIterator<'a>;
21}