BrowserREPL-button-tip-on BrowserREPL-button-tip-off

EditButtonTip 2022-04-12

enum Endian

Indicate endianness (6.d, 2018.12 and later)

enum Endian <NativeEndian LittleEndian BigEndian>;
Code

An enum for indicating endianness, specifically with methods on blob8 and buf8. Consists of NativeEndian, LittleEndian and BigEndian.

Methods§

routine Numeric§

multi method Numeric(Endian:D --> Int:D)
Code

Returns the value part of the enum pair.

say NativeEndian.Numeric;    # OUTPUT: «0␤»
say LittleEndian.Numeric;    # OUTPUT: «1␤»
say BigEndian.Numeric;       # OUTPUT: «2␤»
Code

Note that the actual numeric values are subject to change. So please use the named values instead.

Class relation diagram§

Rakudo Type Relation for Endian Endian Endian Int Int Endian->Int is