Struct spanner_rs::ConfigBuilder
source · [−]pub struct ConfigBuilder { /* private fields */ }
Expand description
Builder for Config
.
Implementations
sourceimpl 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.
sourceimpl 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 RefUnwindSafe for ConfigBuilder
impl Send for ConfigBuilder
impl Sync for ConfigBuilder
impl Unpin for ConfigBuilder
impl UnwindSafe for ConfigBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
sourcefn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request