pub fn to_vec<T>( buf: Vec<u8>, value: &T ) -> Result<Vec<u8>, EncodeError<TryReserveError>>where T: Serialize,
Serializes a value to a writer.