@@ -13,34 +13,34 @@ Install FoundationDB on your system, see [FoundationDB Local Development](https:
1313- Ubuntu Linux (this may work on the Linux subsystem for Windows as well)
1414
1515``` console
16- $> curl -O https://www.foundationdb.org/downloads/6.1.12 /ubuntu/installers/foundationdb-clients_6.1.12 -1_amd64.deb
17- $> curl -O https://www.foundationdb.org/downloads/6.1.12 /ubuntu/installers/foundationdb-server_6.1.12 -1_amd64.deb
18- $> sudo dpkg -i foundationdb-clients_6.1.12 -1_amd64.deb
19- $> sudo dpkg -i foundationdb-server_6.1.12 -1_amd64.deb
16+ $> curl -O https://www.foundationdb.org/downloads/6.2.15 /ubuntu/installers/foundationdb-clients_6.2.25 -1_amd64.deb
17+ $> curl -O https://www.foundationdb.org/downloads/6.2.15 /ubuntu/installers/foundationdb-server_6.2.25 -1_amd64.deb
18+ $> sudo dpkg -i foundationdb-clients_6.2.25 -1_amd64.deb
19+ $> sudo dpkg -i foundationdb-server_6.2.25 -1_amd64.deb
2020```
2121
2222- macOS
2323
2424``` console
25- $> curl -O https://www.foundationdb.org/downloads/6.1.12 /macOS/installers/FoundationDB-6.1.12 .pkg
26- $> sudo installer -pkg FoundationDB-6.1.12 .pkg -target /
25+ $> curl -O https://www.foundationdb.org/downloads/6.2.25 /macOS/installers/FoundationDB-6.2.25 .pkg
26+ $> sudo installer -pkg FoundationDB-6.2.25 .pkg -target /
2727```
2828
2929- Windows
3030
31- https://www.foundationdb.org/downloads/6.1.12 /windows/installers/foundationdb-6.1.12 -x64.msi
31+ https://www.foundationdb.org/downloads/6.2.25 /windows/installers/foundationdb-6.2.25 -x64.msi
3232
3333## Add dependencies on foundationdb-rs
3434
3535``` toml
3636[dependencies ]
37- foundationdb = " 0.4.0 "
37+ foundationdb = " 0.5 "
3838futures = " 0.3"
3939```
4040
4141## Initialization
4242
43- Due to limitations in the C API, the Client and it's associated Network can only be initialized and run once per the life of a process. Generally the ` foundationdb::boot ` function will be enough to initialize the Client. See ` foundationdb::default_api ` and ` foundationdb::builder ` for more configuration options of the Fdb Client.
43+ Due to limitations in the C API, the Client and it's associated Network can only be initialized and run once per the life of a process. Generally the ` foundationdb::run ` function will be enough to initialize the Client. See ` foundationdb::default_api ` and ` foundationdb::builder ` for more configuration options of the Fdb Client.
4444
4545## Example
4646
@@ -65,9 +65,23 @@ async fn async_main() -> foundationdb::FdbResult<()> {
6565 Ok (())
6666}
6767
68- foundationdb :: run (|| {
69- futures :: executor :: block_on (async_main ()). expect (" failed to run" );
70- });
68+ // Safe because drop is called before the program exits
69+ let network = unsafe { foundationdb :: boot () };
70+ futures :: executor :: block_on (async_main ()). expect (" failed to run" );
71+ drop (network );
72+ ```
73+
74+ ``` rust
75+ #[tokio:: main]
76+ async fn main () {
77+ // Safe because drop is called before the program exits
78+ let network = unsafe { foundationdb :: boot () };
79+
80+ // Have fun with the FDB API
81+
82+ // shutdown the client
83+ drop (network );
84+ }
7185```
7286
7387## Migration from 0.4 to 0.5
@@ -87,24 +101,13 @@ drop(network);
87101This can be converted to:
88102
89103``` rust
90- foundationdb :: boot (|| {
91- futures :: executor :: block_on (async_main ()). expect (" failed to run" );
92- }). expect (" failed to boot fdb" );
93- ```
94-
95- or
96-
97- ``` rust
98- #[tokio:: main]
99- async fn main () {
100- // Safe because drop is called before the program exits
101- let network = unsafe { foundationdb :: boot () }. expect (" failed to initialize Fdb" );
104+ // Safe because drop is called before the program exits
105+ let network = unsafe { foundationdb :: boot () };
102106
103- // Have fun with the FDB API
107+ futures :: executor :: block_on ( async_main ()) . expect ( " failed to run " );
104108
105- // shutdown the client
106- drop (network );
107- }
109+ // cleanly shutdown the client
110+ drop (network );
108111```
109112
110113## API stability
0 commit comments