pub struct StorageApi { /* private fields */ }
Expand description
High-level client for BigQuery Storage Write API operations.
Implementations§
Source§impl StorageApi
impl StorageApi
Sourcepub fn create_rows<M: Message>(
table_descriptor: &TableDescriptor,
rows: &[M],
max_size_bytes: usize,
) -> (Rows, usize)
pub fn create_rows<M: Message>( table_descriptor: &TableDescriptor, rows: &[M], max_size_bytes: usize, ) -> (Rows, usize)
Encodes message rows into protobuf format with size management.
Processes as many rows as possible while respecting the specified size limit. Returns the encoded protobuf data and the count of rows successfully processed. When the returned count is less than the input slice length, additional calls are required for remaining rows.
The size limit should be below 10MB to accommodate request metadata overhead; 9MB provides a safe margin.
Sourcepub async fn get_write_stream(
&mut self,
stream_name: &StreamName,
view: WriteStreamView,
) -> Result<WriteStream, BQError>
pub async fn get_write_stream( &mut self, stream_name: &StreamName, view: WriteStreamView, ) -> Result<WriteStream, BQError>
Retrieves metadata for a BigQuery write stream.
Fetches stream information including schema definition and state details according to the specified view level. Higher view levels provide more comprehensive information but may have higher latency.
Sourcepub async fn append_rows(
&mut self,
stream_name: &StreamName,
rows: Rows,
trace_id: String,
) -> Result<Streaming<AppendRowsResponse>, BQError>
pub async fn append_rows( &mut self, stream_name: &StreamName, rows: Rows, trace_id: String, ) -> Result<Streaming<AppendRowsResponse>, BQError>
Appends rows to a BigQuery table using the Storage Write API.
Transmits the provided rows to the specified stream and returns a streaming response for processing results. The trace ID enables request tracking across distributed systems for debugging.
Sourcepub async fn append_table_batches_concurrent<M>(
&self,
table_batches: Vec<TableBatch<M>>,
max_concurrent_streams: usize,
trace_id: &str,
) -> Result<Vec<BatchAppendResult>, BQError>
pub async fn append_table_batches_concurrent<M>( &self, table_batches: Vec<TableBatch<M>>, max_concurrent_streams: usize, trace_id: &str, ) -> Result<Vec<BatchAppendResult>, BQError>
Appends rows from multiple table batches with concurrent processing.
Returns a collection of batch results containing responses, metadata,
and bytes sent for each batch processed. Results are ordered by
completion, not by submission; use BatchAppendResult::batch_index
to correlate with the original input order.
Trait Implementations§
Source§impl Clone for StorageApi
impl Clone for StorageApi
Source§fn clone(&self) -> StorageApi
fn clone(&self) -> StorageApi
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for StorageApi
impl !RefUnwindSafe for StorageApi
impl Send for StorageApi
impl Sync for StorageApi
impl Unpin for StorageApi
impl !UnwindSafe for StorageApi
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request