Options

Options are a special case of enums. It is simply either a 0 for a None option and a 1 plus the value for a Some option. The purpose of the option is to represent a value that may or may not be present, similar to other programming languages' Option or Maybe types.

Examples:

TypeValueEncoded Value
OptionNone0x00
OptionSome(false)0x0100
OptionSome(true)0x0101
Option<vector<u16>>None0x00
Option<vector<u16>>Some([1,65535))0x01020001FFFF