pub struct ConfigBuilder { /* private fields */ }
Expand description
Builder for Config
.
Implementations§
Source§impl ConfigBuilder
impl ConfigBuilder
Sourcepub fn endpoint<VALUE: Into<String>>(self, value: VALUE) -> Self
pub fn endpoint<VALUE: Into<String>>(self, value: VALUE) -> Self
Set the URI to use to reach the Spanner API. Leave unspecified to use Cloud Spanner.
Sourcepub fn tls_config(self, value: ClientTlsConfig) -> Self
pub fn tls_config(self, value: ClientTlsConfig) -> Self
Set custom client-side TLS settings.
Sourcepub fn project<VALUE: Into<String>>(self, value: VALUE) -> Self
pub fn project<VALUE: Into<String>>(self, value: VALUE) -> Self
Specify the GCP project where the Cloud Spanner instance exists.
This may be left unspecified, in which case, the project will be extracted from the credentials. Note that this only works when authenticating using service accounts.
Sourcepub fn instance<VALUE: Into<String>>(self, value: VALUE) -> Self
pub fn instance<VALUE: Into<String>>(self, value: VALUE) -> Self
Set the Cloud Spanner instance ID.
Sourcepub fn database<VALUE: Into<String>>(self, value: VALUE) -> Self
pub fn database<VALUE: Into<String>>(self, value: VALUE) -> Self
Set the Cloud Spanner database name.
Sourcepub fn credentials_file<VALUE: Into<String>>(self, value: VALUE) -> Self
pub fn credentials_file<VALUE: Into<String>>(self, value: VALUE) -> Self
Programatically specify the credentials file to use during authentication.
When this is specified, it is used in favor of the GOOGLE_APPLICATION_CREDENTIALS
environment variable.
Sourcepub fn session_pool_config(self, value: SessionPoolConfig) -> Self
pub fn session_pool_config(self, value: SessionPoolConfig) -> Self
Configuration for the embedded session pool.
Source§impl ConfigBuilder
impl ConfigBuilder
Sourcepub fn disable_tls(self) -> Self
pub fn disable_tls(self) -> Self
Disable TLS when connecting to Spanner. This usually only makes sense when using the emulator. Note that this also disables authentication to prevent sending secrets in plain text.
Sourcepub fn with_emulator_host(self, endpoint: String) -> Self
pub fn with_emulator_host(self, endpoint: String) -> Self
Configure the client to connect to a Spanner emulator, e.g.: http://localhost:9092
This disables TLS.
Sourcepub fn with_emulator_grpc_port(self, port: u16) -> Self
pub fn with_emulator_grpc_port(self, port: u16) -> Self
Configure the client to connect to a Spanner emulator running on localhost and using the specified port. This disables TLS.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ConfigBuilder
impl RefUnwindSafe for ConfigBuilder
impl Send for ConfigBuilder
impl Sync for ConfigBuilder
impl Unpin for ConfigBuilder
impl UnwindSafe for ConfigBuilder
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> 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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§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
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