pub struct ClientBuilder { /* private fields */ }Expand description
Implementations§
Source§impl ClientBuilder
impl ClientBuilder
Sourcepub async fn build(self) -> BuilderResult<Write>
pub async fn build(self) -> BuilderResult<Write>
Sourcepub fn with_endpoint<V: Into<String>>(self, v: V) -> Self
pub fn with_endpoint<V: Into<String>>(self, v: V) -> Self
Sets the endpoint.
§Example
let client = Write::builder()
.with_endpoint("https://private.googleapis.com")
.build()
.await?;Sourcepub fn with_universe_domain<V: Into<String>>(self, v: V) -> Self
pub fn with_universe_domain<V: Into<String>>(self, v: V) -> Self
Configure the universe domain.
The universe domain is the default service domain for a given cloud universe. The default value is “googleapis.com”.
§Example
let client = Write::builder()
.with_universe_domain("googleapis.com")
.build()
.await?;Sourcepub fn with_credentials<V: Into<Credentials>>(self, v: V) -> Self
pub fn with_credentials<V: Into<Credentials>>(self, v: V) -> Self
Configures the authentication credentials.
More information about valid credentials types can be found in the google-cloud-auth crate documentation.
§Example
use google_cloud_auth::credentials::mds;
let client = Write::builder()
.with_credentials(
mds::Builder::default()
.with_scopes(["https://www.googleapis.com/auth/bigquery"])
.build()?)
.build()
.await?;Sourcepub fn with_grpc_subchannel_count(self, v: usize) -> Self
pub fn with_grpc_subchannel_count(self, v: usize) -> Self
Configure the number of subchannels used by the client.
§Example
let count = std::thread::available_parallelism()?.get();
let client = Write::builder()
.with_grpc_subchannel_count(count)
.build()
.await?;gRPC-based clients may exhibit high latency if many requests need to be demuxed over a single HTTP/2 connection (often called a subchannel in gRPC).
Consider using more subchannels if your application creates many writers. Consider using fewer subchannels if your application needs the file descriptors for other purposes.
Sourcepub fn with_pool_size_limit(self, v: usize) -> Self
pub fn with_pool_size_limit(self, v: usize) -> Self
Configure the maximum streams in the client’s multiplexed stream pool.
§Example
let count = std::thread::available_parallelism()?.get();
let client = Write::builder()
.with_pool_size_limit(count)
.build()
.await?;This stream pool is shared by default writers with multiplexing enabled.
The client scales the stream pool up to this limit as the streams in the pool encounter load.
Note that until background stream rebalancing (#6866) is implemented, stream assignment and pool scale-up only occur when a writer is built. If multiple writers are created all at once before writes are in flight, they will all share the same initial stream. To scale across multiple streams, stagger writer creation so writes are in flight when new writers are built.
The default is 8 streams.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ClientBuilder
impl !UnwindSafe for ClientBuilder
impl Freeze for ClientBuilder
impl Send for ClientBuilder
impl Sync for ClientBuilder
impl Unpin for ClientBuilder
impl UnsafeUnpin for ClientBuilder
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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