google_cloud_storage/
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 - Storage
16//!
17//! This crate contains traits, types, and functions to interact with [Google
18//! Cloud Storage]. Most applications will use the structs defined in the
19//! [client] module. More specifically:
20//!
21//! * [Storage][client::Storage]
22//! * [StorageControl][client::StorageControl]
23//!
24//! **WARNING:** this crate is under active development. We expect multiple
25//! breaking changes in the upcoming releases. Testing is also incomplete, we do
26//! **not** recommend that you use this crate in production. We welcome feedback
27//! about the APIs, documentation, missing features, bugs, etc.
28//!
29//! **NOTE:** This crate used to contain a different implementation, with a
30//! different surface. [@yoshidan](https://github.com/yoshidan) generously
31//! donated the crate name to Google. Their crate continues to live as
32//! [gcloud-storage].
33//!
34//! [gcloud-storage]: https://crates.io/crates/gcloud-storage
35//! [Google Cloud Storage]: https://cloud.google.com/storage
36
37pub use gax::Result;
38pub use gax::error::Error;
39
40pub mod backoff_policy;
41pub mod retry_policy;
42pub use crate::storage::upload_source;
43
44mod control;
45mod storage;
46
47/// Clients to interact with Google Cloud Storage.
48pub mod client {
49    pub use crate::control::client::StorageControl;
50    pub use crate::storage::client::{KeyAes256, KeyAes256Error, Storage};
51}
52/// Request builders.
53pub mod builder {
54    pub mod storage {
55        pub use crate::storage::client::ClientBuilder;
56        pub use crate::storage::read_object::ReadObject;
57        pub use crate::storage::upload_object::UploadObject;
58    }
59    pub mod storage_control {
60        pub use crate::control::builder::*;
61        pub use crate::control::client::ClientBuilder;
62    }
63}
64/// The messages and enums that are part of this client library.
65pub use crate::control::model;
66pub use crate::control::stub;
67
68#[allow(dead_code)]
69pub(crate) mod generated;
70
71#[allow(dead_code)]
72pub(crate) mod google {
73    pub mod iam {
74        pub mod v1 {
75            include!("generated/protos/storage/google.iam.v1.rs");
76            include!("generated/convert/iam/convert.rs");
77        }
78    }
79    pub mod longrunning {
80        include!("generated/protos/control/google.longrunning.rs");
81        include!("generated/convert/longrunning/convert.rs");
82    }
83    pub mod r#type {
84        include!("generated/protos/storage/google.r#type.rs");
85        include!("generated/convert/type/convert.rs");
86    }
87    pub mod rpc {
88        include!("generated/protos/storage/google.rpc.rs");
89    }
90    pub mod storage {
91        #[allow(deprecated)]
92        #[allow(clippy::large_enum_variant)]
93        pub mod v2 {
94            include!("generated/protos/storage/google.storage.v2.rs");
95            include!("generated/convert/storage/convert.rs");
96        }
97        pub mod control {
98            pub mod v2 {
99                include!("generated/protos/control/google.storage.control.v2.rs");
100                include!("generated/convert/control/convert.rs");
101            }
102        }
103    }
104}