Skip to main content

Write

Struct Write 

Source
pub struct Write { /* private fields */ }
Expand description

A client for BigQuery Storage Write API.

Implementations§

Source§

impl Write

Source

pub fn builder() -> ClientBuilder

Creates a new ClientBuilder.

Source

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...")
}
Source

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...")
}
Source

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§

Source§

impl Debug for Write

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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 Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl Borrow for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl BorrowMut for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl CastableFromInitialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl CastableFromUninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl From for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext ⓘ

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext ⓘ

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl Into for T
where U: From,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From for U chooses to do.

Source§

impl IntoRequest for T

Source§

fn into_request(self) -> Request

Wrap the input message T in a tonic::Request
Source§

impl LayerExt for L

Source§

fn named_layer(&self, service: S) -> Layered<Layer>::Service, S>
where L: Layer,

Applies the layer to a service and wraps it in Layered.
Source§

impl PolicyExt for T
where T: ?Sized,

Source§

fn and(self, other: P) -> And
where T: Sized + Policy, P: Policy,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or(self, other: P) -> Or
where T: Sized + Policy, P: Policy,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl Same for T

Source§

type Output = T

Should always be Self
Source§

impl TryFrom for T
where U: Into,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result!>

Performs the conversion.
Source§

impl TryInto for T
where U: TryFrom,

Source§

type Error = TryFrom>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> ResultTryFrom>::Error>

Performs the conversion.
Source§

impl VZip for T
where V: MultiLane,

Source§

fn vzip(self) -> V

Source§

impl WithSubscriber for T

Source§

fn with_subscriber(self, subscriber: S) -> WithDispatch ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more