pub struct StorageApi { /* private fields */ }
Expand description
A dataset API handler.
Implementations§
Source§impl StorageApi
impl StorageApi
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>
Append rows to a table via the BigQuery Storage Write API.
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)
This function encodes the rows
slice into a protobuf message
while ensuring that the total size of the encoded rows does
not exceed the max_size
argument. The encoded rows are returned
in the first value of the tuple returned by this function.
Note that it is possible that not all the rows in the rows
slice
were encoded due to the max_size
limit. The callers can find
out how many rows were processed by looking at the second value in
the tuple returned by this function. If the number of rows processed
is less than the number of rows in the rows
slice, then the caller
can call this function again with the rows remaing at the end of the
slice to encode them.
The AppendRows API has a payload size limit of 10MB. Some of the
space in the 10MB limit is used by the request metadata, so the
max_size
argument should be set to a value less than 10MB. 9MB
is a good value to use for the max_size
argument.
pub async fn get_write_stream( &mut self, stream_name: &StreamName, view: WriteStreamView, ) -> Result<WriteStream, BQError>
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