Skip to main content

decode_fixed_element_array

Function decode_fixed_element_array 

Source
pub fn decode_fixed_element_array<T: Decode>(
    buf: &mut &[u8],
    element_size: usize,
) -> Result<Vec<T>, EncodingError>
Expand description

Decode a fixed-element array (no count prefix).

The number of elements is computed by dividing the buffer length by the element size. This function validates that the buffer length is divisible by the element size.