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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
//! Pool configuration.
use Duration;
/// Tunable limits and lifecycle policy for a [`Pool`](crate::Pool).
///
/// Construct one through [`Pool::builder`](crate::Pool::builder) for the fluent
/// path, or assemble it directly — every field is public, so a configuration can
/// equally be deserialized from a settings file. Validation happens when the pool
/// is built, not when the struct is created; see
/// [`Builder::build`](crate::Builder::build).
///
/// # Examples
///
/// ```
/// use std::time::Duration;
/// use pool_mod::PoolConfig;
///
/// // Start from the defaults and adjust only what matters.
/// let cfg = PoolConfig {
/// max_size: 16,
/// min_idle: 2,
/// idle_timeout: Some(Duration::from_secs(300)),
/// ..PoolConfig::default()
/// };
///
/// assert_eq!(cfg.max_size, 16);
/// assert_eq!(cfg.create_timeout, Some(Duration::from_secs(30))); // inherited default
/// ```