pub fn try_rle_encode<T: PartialEq + Copy>( slice: &[T], elem_size: usize, encode_value: fn(T, &mut Vec<u8>), ) -> Option<Vec<u8>>