Literal¶
Match or emit a fixed byte sequence.
On decode, the bytes at the current position must match exactly or
MalformedData is returned. On encode, the fixed bytes are emitted.
The decoded value is None — literals carry no data.
Implements¶
Constructors¶
create¶
Parameters¶
Returns¶
- Literal val^
Public Functions¶
decode¶
Decode the expected byte sequence, returning None on match.
fun box decode(
data: Array[U8 val] val,
offset: USize val)
: ((None val , USize val) | DecodeError)
Parameters¶
Returns¶
- ((None val , USize val) | DecodeError)
encode¶
Parameters¶
- value: None val
Returns¶
- (Array[U8 val] val | EncodeError)