Bytes¶
Constructors¶
create¶
Returns¶
- Bytes val^
Public Functions¶
is_valid_utf8¶
True iff b is well-formed UTF-8 per RFC 3629. Rejects:
* overlong encodings
* surrogates (U+D800..U+DFFF)
* codepoints above U+10FFFF
* truncated sequences
Parameters¶
Returns¶
- Bool val
first_bad_utf8_offset¶
Return the byte offset of the first byte that breaks UTF-8
well-formedness, or AllValid if every byte is fine. The offset
points at the byte where validation failed — for a truncated
sequence, that's the lead byte; for a bad continuation, the bad
byte itself.
Parameters¶
Returns¶
eq¶
Parameters¶
- that: Bytes val
Returns¶
- Bool val
ne¶
Parameters¶
- that: Bytes val
Returns¶
- Bool val