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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
//! `PmmlEnv` — global environment for runtime coordination (thread pool, logger).
//!
//! `PmmlEnv` owns the `Arc<EnvInner>` so it is cheap to `Clone` and `Send+Sync`.
//! Currently it carries a name for diagnostics; the same handle is cloned into each `Session`
//! so dropping the caller's `PmmlEnv` does not invalidate existing sessions.
use Arc;
/// Global environment. Cheap to clone (`Arc` inner).
///
/// It is `Send` + `Sync` and `Clone` is a single atomic increment.
/// `Session::from_bytes` takes `&PmmlEnv` and clones it into the session.
///
/// # Examples
///
/// ```
/// use pmmlruntime::session::PmmlEnv;
/// let env = PmmlEnv::new();
/// let env2 = env.clone(); // cheap
/// assert_eq!(env.name(), env2.name());
/// ```