pub fn to_vec<T: ?Sized>(value: &T, capacity: usize) -> Result<Vec<u8>, Error> where T: Serialize + ?Sized,