sqlload 0.26.0

SQL data loading tooling. Pre-release, under development.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! Read the next answer of an `AppendRows` call.

use crate::bigquery_api::_helpers::grpc::status_error;
use crate::bigquery_api::models::AppendRowsResponse;
use crate::http::errors::ApiError;

/// The next answer on `responses`, `None` once the call has ended cleanly; a call the server ended with an error gives that error.
pub async fn append_answer(
    responses: &mut tonic::Streaming<AppendRowsResponse>,
) -> Result<Option<AppendRowsResponse>, ApiError> {
    responses
        .message()
        .await
        .map_err(|status| status_error(&status))
}