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