pub fn to_binary<T: Serialize, E: Error, F: From<E> + From<StdError>>( data: Result<T, E>, ) -> Result<QueryResponse, F>