Struct spanner_rs::Config
source · [−]pub struct Config { /* private fields */ }
Expand description
Implementations
sourceimpl Config
impl Config
sourcepub fn builder() -> ConfigBuilder
pub fn builder() -> ConfigBuilder
Returns a new ConfigBuilder
for configuring a new client.
sourcepub async fn connect(self) -> Result<Client, Error>
pub async fn connect(self) -> Result<Client, Error>
Connect to Cloud Spanner and return a new Client
.
Example
use spanner_rs::Config;
#[tokio::main]
let mut client = Config::builder()
.project("my-gcp-project")
.instance("my-spanner-instance")
.database("my-database")
.connect()
.await?;
Authentication
Authentication uses the [gcp_auth
] crate which supports several authentication methods.
In a typical production environment, nothing needs to be programatically provided during configuration as
credentials are normally obtained from the environment (i.e.: GOOGLE_APPLICATION_CREDENTIALS
).
Similarly, for local development, authentication will transparently delegate to the gcloud
command line tool.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
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
Mutably borrows from an owned value. Read more
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>
Wrap the input message
T
in a tonic::Request