struct

TextSegment::Grapheme::Cluster

Inherits Struct / Value / Object

Unicode extended grapheme cluster. Graphemes Iterator will return an instance of this struct to return information about specific grapheme cluster.

Instance methods

bytes

returns a byte slice which corresponds to the current grapheme cluster.

Source
codepoints

Returns codepoints which corresponds to the current grapheme cluster.

Source
positions

returns the interval of the current grapheme as byte positions into the original string. The first returned value "from" indexes the first byte and the second retured value "to" indexes the first byte that is not included anumore, i.e. str[from...to] is the current grapheme cluster of the original string "str".

Source
str

returns a substring of the original string which corresponds to the current grapheme cluster

Source