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
//! Sans-IO MongoDB components. The host owns sockets, TLS, DNS, entropy and time.
//! Call `Connection::connected`, complete explicit TLS requests, then drive bytes
//! through `transmit` / `consume_transmit` and `receive` / `poll_event`.
//! One operation per connection follows MongoDB's request/response turn-taking.
//! Raw BSON replies borrow the receive buffer until `release_reply`.
//!
//! # Getting started on turnloop
//! Enable the `turnloop` feature for the `asynchronous` module. The embedding
//! host owns `LocalExecutor` and calls `turn`; adapters await its streams and
//! deadline futures. See the crate README and turnloop-io for ownership, streaming
//! and cancellation examples. Default features retain the sans-I/O API.
//!
//! # Host entropy
//! Every random or unique value comes from the host; nothing here reads OS
//! entropy or a clock. The obligations, all described in one place in the
//! [README's Host entropy section](https://github.com/PerryTS/turnloop/blob/main/protocols/turnloop-mongodb/README.md#host-entropy):
//! - a CSPRNG SCRAM nonce for [`Connection::connected`] when credentials are set;
//! - an `_id` on every inserted document, from [`command::ObjectIdGenerator`]
//! (the server otherwise assigns one the host never learns);
//! - random session UUIDs for [`session::Session::new`] and
//! [`operation::RetrySession`];
//! - selection entropy for [`topology::Topology::choose`].
//!
//! The `turnloop` feature's client supplies all but the `_id`.
use turnloop_wasi_random as _;
pub use bson;
pub use Instant;
pub use ;
pub use ;