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/// Type and value representations and conversion traits.
36pub mod value;
37
38pub use google_cloud_gax::Result;
39pub use google_cloud_gax::error::Error;
40pub use rust_decimal::Decimal;
41
42pub(crate) use google_cloud_gax::client_builder::Result as ClientBuilderResult;
43pub(crate) use google_cloud_gax::options::RequestOptions;
44pub(crate) use google_cloud_gax::options::internal::RequestBuilder;
45pub(crate) use google_cloud_gax::response::Response;
46
47/// Spanner client implementations.
48pub mod client;
49
50/// Consolidates all client and request builders.
51pub mod builder;
52
53/// Crate error types.
54pub mod error;
55
56/// Transaction-scoped interfaces and transaction runners.
57pub mod transaction;
58
59/// Batch execution and query partitioning support.
60pub mod batch;
61
62/// The messages and enums that are part of this client library.
63pub mod model {
64    pub use crate::generated::gapic_dataplane::model::*;
65}
66
67/// Mocking and stub definitions.
68pub mod stub {
69    pub use crate::generated::gapic_dataplane::stub::*;
70}
71
72// Internal modules
73pub(crate) mod batch_dml;
74pub(crate) mod batch_read_only_transaction;
75pub(crate) mod batch_write_transaction;
76pub(crate) mod database_client;
77pub(crate) mod from_value;
78pub(crate) mod partitioned_dml_transaction;
79pub(crate) mod precommit;
80pub(crate) mod read_only_transaction;
81pub(crate) mod read_write_transaction;
82pub(crate) mod result_set;
83pub(crate) mod result_set_metadata;
84pub(crate) mod retry_policy;
85pub(crate) mod row;
86pub(crate) mod server_streaming;
87pub(crate) mod session_maintainer;
88pub(crate) mod timestamp_bound;
89pub(crate) mod to_value;
90pub(crate) mod transaction_retry_policy;
91pub(crate) mod transaction_runner;
92pub(crate) mod types;
93pub(crate) mod write_only_transaction;
94
95mod status;
96
97#[allow(dead_code)]
98#[allow(rustdoc::broken_intra_doc_links)]
99#[allow(rustdoc::private_intra_doc_links)]
100#[allow(clippy::enum_variant_names)]
101pub(crate) mod generated;
102
103#[allow(dead_code)]
104#[allow(clippy::all)]
105pub(crate) mod google {
106    pub mod api {
107        include!("generated/protos/spanner/google.api.rs");
108    }
109    pub mod rpc {
110        include!("generated/protos/spanner/google.rpc.rs");
111    }
112    #[allow(clippy::enum_variant_names)]
113    pub mod spanner {
114        pub mod v1 {
115            include!("generated/protos/spanner/google.spanner.v1.rs");
116            include!("generated/convert/spanner/convert.rs");
117        }
118    }
119}