Skip to main content

get_u8

Function get_u8 

Source
pub fn get_u8(b: &[u8], off: usize) -> u8
Expand description

Reads a u8 at off, or 0 if the slice is too short.

Short reads return zero rather than panicking because every caller here has already checked the length of the whole structure, and a bounds check per field is a branch per field on the recovery path.