deadpool/
lib.rs

1#![doc = include_str!("../README.md")]
2#![cfg_attr(docsrs, feature(doc_cfg))]
3#![deny(
4    nonstandard_style,
5    rust_2018_idioms,
6    rustdoc::broken_intra_doc_links,
7    rustdoc::private_intra_doc_links
8)]
9#![forbid(non_ascii_idents, unsafe_code)]
10#![warn(
11    deprecated_in_future,
12    missing_copy_implementations,
13    missing_debug_implementations,
14    missing_docs,
15    unreachable_pub,
16    unused_import_braces,
17    unused_labels,
18    unused_lifetimes,
19    unused_qualifications,
20    unused_results
21)]
22
23#[cfg(feature = "managed")]
24#[cfg_attr(docsrs, doc(cfg(feature = "managed")))]
25pub mod managed;
26
27#[cfg(feature = "unmanaged")]
28#[cfg_attr(docsrs, doc(cfg(feature = "unmanaged")))]
29pub mod unmanaged;
30
31// For handy re-usage in integration crates.
32#[cfg(feature = "managed")]
33#[doc(hidden)]
34pub use async_trait::async_trait;
35
36pub use deadpool_runtime::{Runtime, SpawnBlockingError};
37
38/// The current pool status.
39#[derive(Clone, Copy, Debug)]
40pub struct Status {
41    /// The maximum size of the pool.
42    pub max_size: usize,
43
44    /// The current size of the pool.
45    pub size: usize,
46
47    /// The number of available objects in the pool. If there are no
48    /// objects in the pool this number can become negative and stores the
49    /// number of futures waiting for an object.
50    pub available: isize,
51}