1
#![doc = include_str!("../crate-docs.md")]
2
#![forbid(unsafe_code)]
3
#![warn(
4
    clippy::cargo,
5
    missing_docs,
6
    // clippy::missing_docs_in_private_items,
7
    clippy::pedantic,
8
    future_incompatible,
9
    rust_2018_idioms,
10
)]
11
#![allow(
12
    clippy::missing_errors_doc, // TODO clippy::missing_errors_doc
13
    clippy::option_if_let_else,
14
    clippy::multiple_crate_versions, // TODO custodian-password deps + x25119 deps
15
)]
16

            
17
#[cfg(feature = "client")]
18
#[doc(inline)]
19
pub use bonsaidb_client as client;
20
#[doc(inline)]
21
pub use bonsaidb_core as core;
22
#[cfg(feature = "files")]
23
#[doc(inline)]
24
pub use bonsaidb_files as files;
25
#[cfg(feature = "local")]
26
#[doc(inline)]
27
pub use bonsaidb_local as local;
28
#[cfg(feature = "server")]
29
#[doc(inline)]
30
pub use bonsaidb_server as server;
31
#[cfg(all(feature = "client", feature = "server"))]
32
mod any_connection;
33
#[cfg(all(feature = "cli", feature = "client", feature = "server"))]
34
pub mod cli;
35

            
36
/// `VaultKeyStorage` implementors.
37
#[cfg(feature = "keystorage-s3")]
38
pub mod keystorage {
39
    #[cfg(feature = "keystorage-s3")]
40
    #[doc(inline)]
41
    pub use bonsaidb_keystorage_s3 as s3;
42
}
43
#[cfg(all(feature = "client", feature = "server"))]
44
pub use any_connection::*;
45

            
46
1
#[test]
47
1
fn struct_sizes() {
48
8
    fn print_size<T: Sized>() {
49
8
        println!(
50
8
            "{}: {} bytes",
51
8
            std::any::type_name::<T>(),
52
8
            std::mem::size_of::<T>()
53
8
        );
54
8
    }
55
1
    #[cfg(feature = "client")]
56
1
    {
57
1
        print_size::<client::AsyncClient>();
58
1
        print_size::<client::AsyncRemoteDatabase>();
59
1
        print_size::<client::AsyncRemoteSubscriber>();
60
1
    }
61
1
    #[cfg(feature = "local")]
62
1
    {
63
1
        print_size::<local::Storage>();
64
1
        print_size::<local::Database>();
65
1
        print_size::<local::Subscriber>();
66
1
        #[cfg(feature = "local-async")]
67
1
        {
68
1
            print_size::<local::AsyncStorage>();
69
1
            print_size::<local::AsyncDatabase>();
70
1
        }
71
1
    }
72
1
    #[cfg(feature = "server")]
73
1
    {
74
1
        print_size::<server::Server>();
75
1
        print_size::<server::ServerDatabase<server::NoBackend>>();
76
1
    }
77
1
}