pub struct Write { /* private fields */ }Expand description
A client for BigQuery Storage Write API.
Implementations§
Source§impl Write
impl Write
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Creates a new ClientBuilder.
Sourcepub fn open_default_streamInto<String>>(
&self,
table: T,
) -> WriterBuilder<DefaultStream>
pub fn open_default_streamInto<String>>(
&self,
table: T,
) -> WriterBuilder<DefaultStream>
Opens the default stream for the given table.
table must have the format
projects/{project}/datasets/{dataset}/tables/{table}.
§Example
let writer = client
.open_default_stream("projects/my-project/datasets/my-dataset/tables/my-table")
.build_arrow(schema())
.await?;
use google_cloud_bigquery::model::ArrowSchema;
fn schema() -> ArrowSchema {
todo!("Define your table's schema...")
}Sourcepub fn create_streamApplicationCreatedStream, T: Into<String>>(
&self,
table: T,
) -> WriterBuilder
pub fn create_streamApplicationCreatedStream, T: Into<String>>(
&self,
table: T,
) -> WriterBuilder
Creates a new application-created stream for the given table.
table must have the format
projects/{project}/datasets/{dataset}/tables/{table}.
The stream type S can be inferred from the variable’s writer type
annotation
(PendingWriter,
CommittedWriter, or
BufferedWriter) or specified explicitly via turbofish
(create_stream::).
See Selecting a type for guidance on choosing a stream type for your workload.
§Example
use google_cloud_bigquery::write::PendingWriter;
use google_cloud_bigquery::write::format::Arrow;
let writer: PendingWriter = client
.create_stream("projects/my-project/datasets/my-dataset/tables/my-table")
.build_arrow(schema())
.await?;
use google_cloud_bigquery::model::ArrowSchema;
fn schema() -> ArrowSchema {
todo!("Define your table's schema...")
} Sourcepub fn attach_to_streamApplicationCreatedStream, T: Into<String>>(
&self,
write_stream: T,
) -> WriterBuilder
pub fn attach_to_streamApplicationCreatedStream, T: Into<String>>(
&self,
write_stream: T,
) -> WriterBuilder
Attaches a writer to an existing application-created stream.
write_stream must have the format
projects/{project}/datasets/{dataset}/tables/{table}/streams/{stream}.
The stream type S can be inferred from the variable’s writer type
annotation
(PendingWriter,
CommittedWriter, or
BufferedWriter) or specified explicitly via turbofish
(attach_to_stream::).
§Example
use google_cloud_bigquery::write::CommittedWriter;
use google_cloud_bigquery::write::format::Arrow;
let writer: CommittedWriter = client
.attach_to_stream("projects/my-project/datasets/my_dataset/tables/my_table/streams/my_stream")
.build_arrow(schema())
.await?; Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Write
impl !UnwindSafe for Write
impl Freeze for Write
impl Send for Write
impl Sync for Write
impl Unpin for Write
impl UnsafeUnpin for Write
Blanket Implementations§
Source§impl BorrowMut for Twhere
T: ?Sized,
impl BorrowMut for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl CastableFromInitialized, Initialized> for DT
impl CastableFromUninit, Uninit> for DT
Source§impl FutureExt for T
impl FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext ⓘ
fn with_context(self, otel_cx: Context) -> WithContext ⓘ
Source§fn with_current_context(self) -> WithContext ⓘ
fn with_current_context(self) -> WithContext ⓘ
Source§impl Instrument for T
impl Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented ⓘ
fn instrument(self, span: Span) -> Instrumented ⓘ
Source§fn in_current_span(self) -> Instrumented ⓘ
fn in_current_span(self) -> Instrumented ⓘ
Source§impl IntoRequest for T
impl IntoRequest for T
Source§fn into_request(self) -> Request
fn into_request(self) -> Request
T in a tonic::Request