std.bytes
Slicing and searching over uint8[] — what a wire protocol does between reads.
The edges mirror string.substring exactly: a negative start or count panics, a
start past the end panics, and a count past the end clamps to it. indexOf answers
-1 when nothing is found — ready for slice, as string.indexOf is for substring.
slice function
pub fn slice(bytes: uint8[], start: int, count: int): uint8[]
count bytes from start, clamped at the end like string.substring.
stdlib/std/bytes.lyr:16
indexOf function
pub fn indexOf(bytes: uint8[], value: uint8): int
The first position of value, or -1 — ready for slice.
stdlib/std/bytes.lyr:40
indexOfFrom function
pub fn indexOfFrom(bytes: uint8[], value: uint8, start: int): int
Searches from a position. -1 when nothing is found, as in indexOf; a negative start
searches from the front, one past the end finds nothing.
stdlib/std/bytes.lyr:46