pub fn to_binary<T>(data: &T) -> StdResult<Binary>where
    T: Serialize + ?Sized,