Expand description
FoundationDB Client API for Tokio
Guide level documentation is on our website. You will find API level documentation here.
A minimal example to get started.
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(())
}
Modules
Provides FdbDatabase
type for working with FDB Database.
Provides FdbFuture
, FdbStreamKeyValue
types and
FdbFutureGet
trait for working with FDB Future.
Provides types for working with FDB range.
Provides a convenient way to define namespaces for different categories of data.
Provides types and traits for working with FDB Transactions and Snapshots.
Provides a set of utilities for serializing and deserializing typed data for use in FDB.
Structs
Enums
A set of options that can be set globally for the FDB API.
Constants
Maximum API version supported by the client
Functions
Returns FdbDatabase
handle to the FDB cluster identified by
the provided cluster file.
Select the version of the client API.
Set global options for the FDB API.
Initializes FDB network.
Stops the FDB networking engine.