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//! **NOTE:** This crate used to contain a different implementation, with a
25//! different surface. [@yoshidan](https://github.com/yoshidan) generously
26//! donated the crate name to Google. Their crate continues to live as
27//! [gcloud-storage].
28//!
29//! [gcloud-storage]: https://crates.io/crates/gcloud-storage
30//! [Google Cloud Storage]: https://cloud.google.com/storage
31
32pub use gax::Result;
33pub use gax::error::Error;
34
35pub mod backoff_policy;
36#[cfg(google_cloud_unstable_storage_bidi)]
37pub mod object_descriptor;
38pub mod read_object;
39pub mod read_resume_policy;
40pub mod retry_policy;
41pub use crate::storage::request_options;
42pub use crate::storage::streaming_source;
43
44mod control;
45mod storage;
46
47pub mod client {
48    //! Clients to interact with Google Cloud Storage.
49    pub use crate::control::client::StorageControl;
50    pub use crate::storage::client::Storage;
51}
52pub mod builder {
53    //! Request builders.
54    pub mod storage {
55        //! Request builders for [Storage][crate::client::Storage].
56        pub use crate::storage::client::ClientBuilder;
57        #[cfg(google_cloud_unstable_storage_bidi)]
58        pub use crate::storage::open_object::OpenObject;
59        pub use crate::storage::read_object::ReadObject;
60        pub use crate::storage::write_object::WriteObject;
61    }
62    pub mod storage_control {
63        //! Request builders for [StorageControl][crate::client::StorageControl].
64        pub use crate::control::builder::*;
65        pub use crate::control::client::ClientBuilder;
66    }
67}
68pub mod error;
69/// The messages and enums that are part of this client library.
70pub use crate::control::model;
71pub mod builder_ext;
72pub mod model_ext;
73pub mod stub {
74    //! Traits to mock the clients in this library.
75    //!
76    //! Application developers may need to mock the clients in this library to test
77    //! how their application works with different (and sometimes hard to trigger)
78    //! client and service behavior. Such test can define mocks implementing the
79    //! trait(s) defined in this module, initialize the client with an instance of
80    //! this mock in their tests, and verify their application responds as expected.
81    pub use crate::control::stub::*;
82    pub use crate::storage::stub::*;
83    pub use crate::storage::transport::Storage as DefaultStorage;
84}
85
86#[allow(dead_code)]
87pub(crate) mod generated;
88
89#[allow(dead_code)]
90pub(crate) mod google {
91    pub mod iam {
92        pub mod v1 {
93            include!("generated/protos/storage/google.iam.v1.rs");
94            include!("generated/convert/iam/convert.rs");
95        }
96    }
97    pub mod longrunning {
98        include!("generated/protos/control/google.longrunning.rs");
99        include!("generated/convert/longrunning/convert.rs");
100    }
101    pub mod r#type {
102        include!("generated/protos/storage/google.r#type.rs");
103        include!("generated/convert/type/convert.rs");
104    }
105    pub mod rpc {
106        include!("generated/protos/storage/google.rpc.rs");
107    }
108    pub mod storage {
109        #[allow(deprecated)]
110        #[allow(clippy::large_enum_variant)]
111        pub mod v2 {
112            include!("generated/protos/storage/google.storage.v2.rs");
113            include!("generated/convert/storage/convert.rs");
114        }
115        pub mod control {
116            pub mod v2 {
117                include!("generated/protos/control/google.storage.control.v2.rs");
118                include!("generated/convert/control/convert.rs");
119            }
120        }
121    }
122}