Graphemes¶
Constructors¶
create¶
Returns¶
- Graphemes val^
Public Functions¶
count¶
Number of extended grapheme clusters in s per UAX #29.
Returns InvalidUtf8 if s isn't well-formed UTF-8 — error
carries the byte offset of the first ill-formed sequence.
Parameters¶
- s: String box
Returns¶
- (USize val | InvalidUtf8 val)
ranges¶
Iterator over the byte ranges [start, end_exclusive) of each
grapheme cluster in s. No per-yield allocation. Returns
InvalidUtf8 if s isn't well-formed UTF-8.
Parameters¶
- s: String box
Returns¶
- (Iterator[(USize val , USize val)] ref | InvalidUtf8 val)
iter¶
Iterator yielding each grapheme cluster as a String val slice
(zero byte-copy; one small String wrapper allocation per yield).
Takes String val because the yielded slices share the same val
buffer. Returns InvalidUtf8 if s isn't well-formed.
Parameters¶
- s: String val
Returns¶
- (Iterator[String val] ref | InvalidUtf8 val)
eq¶
Parameters¶
- that: Graphemes val
Returns¶
- Bool val
ne¶
Parameters¶
- that: Graphemes val
Returns¶
- Bool val