pub fn to_vec_with_capacity<'a, T>(
    value: &'a T,
    cap: usize
) -> Result<Vec<u32>, Error> where
    T: Serialize + ?Sized