Function sub [src]
Provide the length they claim, and receive a sub-decoder specific to that slice.
The parent decoder is advanced to the end.
Prototype
pub fn sub(d: *Decoder, their_len: usize) !Decoder
Parameters
d: *Decoder
their_len: usize
Source
pub fn sub(d: *Decoder, their_len: usize) !Decoder {
const end = d.idx + their_len;
if (end > d.their_end) return error.TlsDecodeError;
const sub_buf = d.buf[d.idx..end];
d.idx = end;
d.our_end = end;
return fromTheirSlice(sub_buf);
}