dropbox_sdk/
lib.rs

1// Copyright (c) 2019-2025 Dropbox, Inc.
2
3#![deny(missing_docs, rust_2018_idioms)]
4// Enable a nightly feature for docs.rs which enables decorating feature-gated items.
5// To enable this manually, run e.g. `cargo rustdoc --all-features -- --cfg docsrs`.
6#![cfg_attr(docsrs, feature(doc_cfg))]
7#![cfg_attr(docsrs, doc = include_str!("../README.md"))]
8#![cfg_attr(
9    not(docsrs),
10    doc = "Dropbox SDK for Rust. See README.md for more details."
11)]
12
13/// Feature-gate something and also decorate it with the feature name on docs.rs.
14macro_rules! if_feature {
15    ($feature_name:expr, $($item:item)*) => {
16        $(
17            #[cfg(feature = $feature_name)]
18            #[cfg_attr(docsrs, doc(cfg(feature = $feature_name)))]
19            $item
20        )*
21    };
22    (not $feature_name:expr, $($item:item)*) => {
23        $(
24            #[cfg(not(feature = $feature_name))]
25            #[cfg_attr(docsrs, doc(cfg(not(feature = $feature_name))))]
26            $item
27        )*
28    };
29}
30
31#[macro_use]
32extern crate log;
33
34if_feature! { "default_client",
35    pub mod default_client;
36
37    // for backwards-compat only; don't match this for async
38    if_feature! { "sync_routes_in_root",
39        pub use client_trait::*;
40    }
41}
42
43if_feature! { "default_async_client", pub mod default_async_client; }
44
45#[cfg(any(feature = "default_client", feature = "default_async_client"))]
46mod default_client_common;
47
48mod client_trait_common;
49
50pub mod client_trait;
51
52pub mod async_client_trait;
53
54mod client_helpers;
55
56pub mod oauth2;
57
58// You need to run the Stone generator to create this module.
59#[rustfmt::skip]
60mod generated;
61pub use generated::*;
62
63#[cfg(feature = "async_routes")]
64#[cfg(not(feature = "sync_routes_in_root"))]
65pub use async_routes::*;
66
67#[cfg(feature = "sync_routes")]
68#[cfg(feature = "sync_routes_in_root")]
69pub use sync_routes::*;
70
71mod error;
72pub use error::{BoxedError, Error, NoError};