|
304 | 304 | #[cfg(all(feature = "aws-auth", feature = "async-std-runtime"))]
|
305 | 305 | compile_error!("The `aws-auth` feature flag is only supported on the tokio runtime.");
|
306 | 306 |
|
307 |
| -macro_rules! define_if_single_runtime_enabled { |
308 |
| - ( $( $def:item )+ ) => { |
309 |
| - $( |
310 |
| - #[cfg(any( |
311 |
| - all(feature = "tokio-runtime", not(feature = "async-std-runtime")), |
312 |
| - all(not(feature = "tokio-runtime"), feature = "async-std-runtime") |
313 |
| - ))] |
314 |
| - $def |
315 |
| - )+ |
316 |
| - } |
317 |
| -} |
| 307 | +#[macro_use] |
| 308 | +pub mod options; |
318 | 309 |
|
319 |
| -// In the case that neither tokio nor async-std is enabled, we want to disable all compiler errors |
320 |
| -// and warnings other than our custom ones. |
321 |
| -define_if_single_runtime_enabled! { |
322 |
| - #[macro_use] |
323 |
| - pub mod options; |
| 310 | +pub use ::bson; |
324 | 311 |
|
325 |
| - pub use ::bson; |
| 312 | +mod bson_util; |
| 313 | +mod client; |
| 314 | +mod cmap; |
| 315 | +mod coll; |
| 316 | +mod collation; |
| 317 | +mod compression; |
| 318 | +mod concern; |
| 319 | +mod cursor; |
| 320 | +mod db; |
| 321 | +pub mod error; |
| 322 | +pub mod event; |
| 323 | +mod index; |
| 324 | +mod is_master; |
| 325 | +mod operation; |
| 326 | +pub mod results; |
| 327 | +pub(crate) mod runtime; |
| 328 | +mod sdam; |
| 329 | +mod selection_criteria; |
| 330 | +mod srv; |
| 331 | +#[cfg(any(feature = "sync", docsrs))] |
| 332 | +#[cfg_attr(docsrs, doc(cfg(feature = "sync")))] |
| 333 | +pub mod sync; |
| 334 | +#[cfg(test)] |
| 335 | +mod test; |
326 | 336 |
|
327 |
| - mod bson_util; |
328 |
| - mod client; |
329 |
| - mod cmap; |
330 |
| - mod coll; |
331 |
| - mod collation; |
332 |
| - mod compression; |
333 |
| - mod concern; |
334 |
| - mod cursor; |
335 |
| - mod db; |
336 |
| - pub mod error; |
337 |
| - pub mod event; |
338 |
| - mod index; |
339 |
| - mod is_master; |
340 |
| - mod operation; |
341 |
| - pub mod results; |
342 |
| - pub(crate) mod runtime; |
343 |
| - mod sdam; |
344 |
| - mod selection_criteria; |
345 |
| - mod srv; |
346 |
| - #[cfg(any(feature = "sync", docsrs))] |
347 |
| - #[cfg_attr(docsrs, doc(cfg(feature = "sync")))] |
348 |
| - pub mod sync; |
349 |
| - #[cfg(test)] |
350 |
| - mod test; |
| 337 | +#[cfg(test)] |
| 338 | +#[macro_use] |
| 339 | +extern crate derive_more; |
351 | 340 |
|
352 |
| - #[cfg(test)] |
353 |
| - #[macro_use] |
354 |
| - extern crate derive_more; |
| 341 | +#[cfg(not(feature = "sync"))] |
| 342 | +pub use crate::{ |
| 343 | + client::{Client, session::ClientSession}, |
| 344 | + coll::Collection, |
| 345 | + cursor::{Cursor, session::{SessionCursor, SessionCursorStream}}, |
| 346 | + db::Database, |
| 347 | +}; |
355 | 348 |
|
356 |
| - #[cfg(not(feature = "sync"))] |
357 |
| - pub use crate::{ |
358 |
| - client::{Client, session::ClientSession}, |
359 |
| - coll::Collection, |
360 |
| - cursor::{Cursor, session::{SessionCursor, SessionCursorStream}}, |
361 |
| - db::Database, |
362 |
| - }; |
| 349 | +#[cfg(feature = "sync")] |
| 350 | +pub(crate) use crate::{ |
| 351 | + client::{Client, session::ClientSession}, |
| 352 | + coll::Collection, |
| 353 | + cursor::{Cursor, session::{SessionCursor, SessionCursorStream}}, |
| 354 | + db::Database, |
| 355 | +}; |
363 | 356 |
|
364 |
| - #[cfg(feature = "sync")] |
365 |
| - pub(crate) use crate::{ |
366 |
| - client::{Client, session::ClientSession}, |
367 |
| - coll::Collection, |
368 |
| - cursor::{Cursor, session::{SessionCursor, SessionCursorStream}}, |
369 |
| - db::Database, |
370 |
| - }; |
371 |
| - |
372 |
| - pub use {coll::Namespace, index::IndexModel, client::session::ClusterTime}; |
373 |
| -} |
| 357 | +pub use {coll::Namespace, index::IndexModel, client::session::ClusterTime}; |
374 | 358 |
|
375 | 359 | #[cfg(all(
|
376 | 360 | feature = "tokio-runtime",
|
|
0 commit comments