Skip to main content

google_cloud_spanner/
lib.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15//! Google Cloud Client Libraries for Rust - Spanner
16//!
17//! **WARNING:** this is a preview release of the crate. We believe the APIs to be stable. We also
18//! are seeking feedback about the APIs and may need to make breaking changes if we discover that
19//! some parts are hard to use.
20//!
21//! We welcome feedback about the APIs, documentation, missing features, bugs, etc.
22
23// Public domain modules.
24
25/// Key and key range definition types.
26pub mod key;
27/// Write mutations and transaction commit binders.
28pub mod mutation;
29/// Configurable read requests and builders.
30pub mod read;
31/// Spanner execution result streams and rows.
32pub mod result;
33/// SQL statement builders and parameter bindings.
34pub mod statement;
35/// Spanner primitive type constructors for typed parameter binding.
36pub mod types;
37/// Type and value representations and conversion traits.
38pub mod value;
39
40pub use google_cloud_gax::Result;
41pub use google_cloud_gax::error::Error;
42pub use rust_decimal::Decimal;
43
44pub(crate) use google_cloud_gax::client_builder::Result as ClientBuilderResult;
45pub(crate) use google_cloud_gax::options::RequestOptions;
46pub(crate) use google_cloud_gax::options::internal::RequestBuilder;
47pub(crate) use google_cloud_gax::response::Response;
48
49/// Spanner client implementations.
50pub mod client;
51
52/// Consolidates all client and request builders.
53pub mod builder;
54
55/// Crate error types.
56pub mod error;
57
58/// Transaction-scoped interfaces and transaction runners.
59pub mod transaction;
60
61/// Batch execution and query partitioning support.
62pub mod batch;
63
64/// The messages and enums that are part of this client library.
65pub mod model {
66    pub use crate::generated::gapic_dataplane::model::*;
67}
68
69/// Mocking and stub definitions.
70pub mod stub {
71    pub use crate::generated::gapic_dataplane::stub::*;
72}
73
74// Internal modules
75pub(crate) mod batch_dml;
76pub(crate) mod batch_read_only_transaction;
77pub(crate) mod batch_write_transaction;
78pub(crate) mod database_client;
79pub(crate) mod from_value;
80pub(crate) mod partitioned_dml_transaction;
81pub(crate) mod precommit;
82pub(crate) mod read_only_transaction;
83pub(crate) mod read_write_transaction;
84pub(crate) mod result_set;
85pub(crate) mod result_set_metadata;
86pub(crate) mod retry_policy;
87pub(crate) mod row;
88pub(crate) mod server_streaming;
89pub(crate) mod session_maintainer;
90pub(crate) mod timestamp_bound;
91pub(crate) mod to_value;
92pub(crate) mod transaction_retry_policy;
93pub(crate) mod transaction_runner;
94pub(crate) mod write_only_transaction;
95
96mod status;
97
98#[allow(dead_code)]
99#[allow(rustdoc::broken_intra_doc_links)]
100#[allow(rustdoc::private_intra_doc_links)]
101#[allow(clippy::enum_variant_names)]
102pub(crate) mod generated;
103
104#[allow(dead_code)]
105#[allow(clippy::all)]
106pub(crate) mod google {
107    pub mod api {
108        include!("generated/protos/spanner/google.api.rs");
109    }
110    pub mod rpc {
111        include!("generated/protos/spanner/google.rpc.rs");
112    }
113    #[allow(clippy::enum_variant_names)]
114    pub mod spanner {
115        pub mod v1 {
116            include!("generated/protos/spanner/google.spanner.v1.rs");
117            include!("generated/convert/spanner/convert.rs");
118        }
119    }
120}