1#![doc = include_str!("../README.md")]
2#![warn(
3 missing_docs,
4 rustdoc::missing_crate_level_docs,
5 clippy::cast_possible_truncation,
6 clippy::cast_possible_wrap,
7 clippy::cast_sign_loss
8)]
9#![allow(
10 clippy::unreadable_literal,
11 clippy::cognitive_complexity,
12 clippy::float_cmp,
13 clippy::match_like_matches_macro,
14 clippy::derive_partial_eq_without_eq
15)]
16#![cfg_attr(docsrs, feature(doc_cfg))]
17#![cfg_attr(test, type_length_limit = "80000000")]
18#![doc(html_root_url = "https://docs.rs/mongodb/3.5.2")]
19
20#[macro_use]
21pub mod options;
22
23#[cfg(feature = "in-use-encryption")]
24pub use ::mongocrypt;
25
26pub mod action;
27pub mod atlas_search;
28mod base64;
29pub(crate) mod bson_compat;
30mod bson_util;
31pub mod change_stream;
32pub(crate) mod checked;
33mod client;
34mod cmap;
35mod coll;
36mod collation;
37mod compression;
38mod concern;
39pub(crate) mod cursor;
40mod db;
41pub mod error;
42pub mod event;
43pub mod gridfs;
44mod hello;
45pub(crate) mod id_set;
46mod index;
47mod operation;
48#[cfg(feature = "opentelemetry")]
49pub mod otel;
50pub mod results;
51pub(crate) mod runtime;
52mod sdam;
53mod search_index;
54mod selection_criteria;
55mod serde_util;
56mod srv;
57#[cfg(feature = "sync")]
58pub mod sync;
59#[cfg(test)]
60mod test;
61#[cfg(feature = "tracing-unstable")]
62mod trace;
63pub(crate) mod tracking_arc;
64
65#[cfg(not(any(feature = "bson-2", feature = "bson-3")))]
66compile_error!("One of the bson-2 and bson-3 features must be enabled.");
67
68#[cfg(all(feature = "bson-2", not(feature = "bson-3")))]
69pub use bson2 as bson;
70
71#[cfg(feature = "bson-3")]
72pub use bson3 as bson;
73
74#[cfg(feature = "in-use-encryption")]
75pub use crate::client::csfle::client_encryption;
76pub use crate::{
77 client::{session::ClientSession, Client},
78 coll::Collection,
79 cursor::{
80 raw_batch as raw_batch_cursor,
81 session::{SessionCursor, SessionCursorStream},
82 Cursor,
83 },
84 db::Database,
85};
86
87pub use client::session::ClusterTime;
88pub use coll::Namespace;
89pub use index::IndexModel;
90pub use sdam::public::*;
91pub use search_index::{SearchIndexModel, SearchIndexType};
92
93pub type BoxFuture<'a, T> = std::pin::Pin<Box<dyn std::future::Future<Output = T> + Send + 'a>>;
95
96#[cfg(not(feature = "compat-3-3-0"))]
97compile_error!(
98 "The feature 'compat-3-3-0' must be enabled to ensure forward compatibility with future \
99 versions of this crate."
100);