DoxigAlpha

Decoder

An abstraction to ensure that protocol-parsing code does not perform an out-of-bounds read.

Fields of this type

Fields

#
buf:[]u8
idx:usize
Points to the next byte in buffer that will be decoded.
our_end:usize
Up to this point in `buf` we have already checked that `cap` is greater than it.
their_end:usize
Beyond this point in `buf` is extra tag-along bytes beyond the amount we
cap:usize
Points to the end within buffer that has been filled.
disable_reads:bool
Debug helper to prevent illegal calls to read functions.

Functions in this namespace

Functions

#
readAtLeast
Use this function to increase `their_end`.
readAtLeastOurAmt
Same as `readAtLeast` but also increases `our_end` by exactly `our_amt`.
ensure
Use this function to increase `our_end`.
decode
Use this function to increase `idx`.
array
Use this function to increase `idx`.
slice
Use this function to increase `idx`.
skip
Use this function to increase `idx`.
sub
Provide the length they claim, and receive a sub-decoder specific to that slice.