Pf::GraphemeView
Inherits Struct / Value / Object
Represents a single grapheme as a view into a string.
NOTE: GraphemeView, just like GraphemeSeln, refers back to the trunk
string, which could be very large. This may prevent the GC from freeing large
chunks of memory due to a small number of grapheme views that refer to it. For
this reason, you are advised not to store GraphemeViews on the heap unless
you know for sure their lifetime is less than or equal to the lifetime of the trunk
string. Otherwise, use to_grapheme. In general, when working with GraphemeView,
the reasoning should be the same as with GraphemeSeln; in that they carry around,
at least conceptually, the larger context as well.
EXPERIMENTAL: Relies on features from the experimental String::Grapheme API.
Instance methods
Returns an exclusive range of the indices of the contituent bytes of this grapheme in the trunk string.
Returns a read-only view of the underling bytes of this grapheme. The view is a subview of the trunk string's bytes.