Library / Collections / Dictionaries / BinaryWord
BinaryWord
A BORROWED window onto a run of bytes: the array, where the run starts, and
how long it is. Value-copied and inline — copying a BinaryWord copies three
machine words, never the bytes.
Constructors 1
INIT(REFERENCE binary[] src, int64 off, int64 len)
Methods 7
METHOD length() RETURNS int64reads
Bytes in the window.
METHOD offset() RETURNS int64reads
Where the window opens in the underlying pool. A caller holding the pool
can use this with length() to reach the bytes directly — which is how
the slice fast paths avoid going through the window at all.
METHOD at(int64 i) RETURNS | binaryreads
The byte at i within the window, or FAILURE when i is outside it.
METHOD clone() RETURNS BinaryWordreads
METHOD hash() RETURNS uint64reads
METHOD equals(REFERENCE BinaryWord other) RETURNS booleanreads
Equal when the windows hold the same bytes — not when they name the same place. Two words over different pools are equal if their bytes match.
METHOD isLessThan(REFERENCE BinaryWord other) RETURNS booleanreads
Lexicographic by bytes, shorter-is-less on a shared prefix — the order a byte-keyed tree needs to stay total.