module pkg::alloy::text::unicode::graphemessource
Extended grapheme clusters, by UAX #29's rules (Unicode 16.0): what a caret steps over and a selection takes whole.
grapheme_boundariesnext_graphemeprevious_grapheme_fromGraphemeStateGraphemeState::startbreaks_beforeadvance
fn grapheme_boundariessource
exp fn grapheme_boundaries(text: &[u8]) -> Vector<u64>
The byte offsets where clusters start, then the text's length: every boundary, the first and last included (none for empty text).
fn next_graphemesource
exp fn next_grapheme(text: &[u8], at: u64) -> u64
The boundary after at, itself a boundary, or the text's length.
fn previous_grapheme_fromsource
exp fn previous_grapheme_from(text: &[u8], from: u64, at: u64) -> u64
The boundary before at, itself a boundary, or from: scanning from
from, a boundary known to come before at.
type GraphemeStatesource
exp type GraphemeState = struct
What the rules need to know of the text before a position.
Functions
fn GraphemeState::startsource
exp fn GraphemeState::start() -> GraphemeState
fn breaks_beforesource
exp fn breaks_before(self s: &GraphemeState, value: u32) -> bool
fn advancesource
exp fn advance(self s: &var GraphemeState, value: u32)