Expand description
Networked client for bonsaidb-server
.
This crate supports two methods for accessing a BonsaiDb server: QUIC and WebSockets.
QUIC is a new protocol built atop UDP. It is designed to operate more reliably than TCP, and features TLS built-in at the protocol level. WebSockets are an established protocol built atop TCP and HTTP.
BlockingClient
provides access to BonsaiDb by implementing
the StorageConnection
trait.
AsyncClient
provides access to BonsaiDb by implementing
the AsyncStorageConnection
trait.
Minimum Supported Rust Version (MSRV)
While this project is alpha, we are actively adopting the current version of
Rust. The current minimum version is 1.70
.
WASM Support
This crate supports compiling to WebAssembly. When using WebAssembly, the only protocol available is WebSockets.
Testing Websockets in a Browser
We have a fully deployed example application available that can be downloaded and run locally. This example is confirmed to work using Firefox on a local machine, or any modern browser when accessing https://minority-game.gooey.rs/.
- Ensure that the browser is able to talk to the IP/port that you’re bound to.
Browsers try to prevent malicious scripts. You may need to bind
0.0.0.0
instead oflocalhost
, for example, to circumvent these protections. - All Chrome-based browsers require secure websockets over localhost. This makes Chrome not a great candidate for testing WASM applications locally, as installing a valid certificate in a test/dev environment can be tricky and/or annoying.
Modules
- TODO
- rust-url is an implementation of the URL Standard for the Rust programming language.
Structs
- A callback that is invoked when an
Api::Response
value is received out-of-band (not in reply to a request). - Client for connecting to a BonsaiDb server.
- A database on a remote server.
- A
PubSub
subscriber from a remote server. - A BonsaiDb client that blocks the current thread when performing requests.
- A remote database that blocks the current thread when performing its requests.
- A remote PubSub
Subscriber
that blocks the current thread when performing requests. - Builder for a
BlockingClient
or anAsyncClient
.
Enums
- An error returned from an api request.
- Errors related to working with the BonsaiDb client.