1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#![warn(
    missing_debug_implementations,
    missing_docs,
    rust_2018_idioms,
    unreachable_pub
)]

//! FoundationDB Client API for Tokio
//!
//! Guide level documentation is on our [website]. You will find API
//! level documentation here.
//!
//! [website]: https://fdb-rs.github.io/docs/getting-started/introduction/
//!
//! A minimal example to get started.
//!
//! ```no_run
//! use tokio::runtime::Runtime;
//!
//! use std::env;
//! use std::error::Error
//!
//! fn main() -> Result<(), Box<dyn Error>> {
//!     let fdb_cluster_file = env::var("FDB_CLUSTER_FILE").expect("FDB_CLUSTER_FILE not defined!");
//!
//!     unsafe {
//!         fdb::select_api_version(710);
//!         fdb::start_network();
//!     }
//!
//!     let fdb_database = fdb::open_database(fdb_cluster_file)?;
//!
//!     let rt = Runtime::new()?;
//!
//!     let cloned_fdb_database = fdb_database.clone();
//!
//!     rt.block_on(async {
//!         let fdb_database = cloned_fdb_database;
//!
//!         // your main async app here
//!
//!         Result::<(), Box<dyn Error>>::Ok(())
//!     })?;
//!
//!     drop(fdb_database);
//!
//!     unsafe {
//!         fdb::stop_network();
//!     }
//!
//!     Ok(())
//! }
//! ```

mod fdb;
mod key_value;
mod option;

#[cfg(feature = "fdb-7_1")]
mod mapped_key_value;

#[cfg(feature = "fdb-7_1")]
mod mapped_range;

pub mod database;
pub mod error;
pub mod future;
pub mod range;
pub mod subspace;
pub mod transaction;
pub mod tuple;

#[cfg(feature = "fdb-7_1")]
pub mod tenant;

/// Maximum API version supported by the client
pub use fdb_sys::FDB_API_VERSION;

pub use crate::fdb::{select_api_version, set_network_option, start_network, stop_network};

pub use crate::key_value::{Key, KeySelector, KeyValue, Value};

pub use crate::database::open_database::open_database;

pub use crate::option::NetworkOption;

#[cfg(feature = "fdb-7_1")]
pub use crate::mapped_key_value::{MappedKeyValue, Mapper};

#[cfg(feature = "fdb-7_1")]
pub use crate::tenant::tenant_inner::Tenant;