pub fn to_packet_batches<T>(
    items: &[T],
    chunk_size: usize
) -> Vec<PacketBatch, Global> where
    T: Serialize,