Skip to content

Bytes

[Source]

primitive val Bytes

Constructors

create

[Source]

new val create()
: Bytes val^

Returns


Public Functions

is_valid_utf8

[Source]

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

fun box is_valid_utf8(
  b: (String box | Array[U8 val] box))
: Bool val

Parameters

Returns


first_bad_utf8_offset

[Source]

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.

fun box first_bad_utf8_offset(
  b: (String box | Array[U8 val] box))
: (USize val | AllValid val)

Parameters

Returns


eq

[Source]

fun box eq(
  that: Bytes val)
: Bool val

Parameters

Returns


ne

[Source]

fun box ne(
  that: Bytes val)
: Bool val

Parameters

Returns