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
//! Lightweight wrappers that expose plotting-specific helpers without requiring
//! downstream crates to depend directly on the plotting feature flag.
/// Reset the per-thread "figures touched" set. No-op when plotting is disabled.
pub fn reset_recent_figures() {
#[cfg(feature = "plot-core")]
{
crate::builtins::plotting::reset_recent_figures();
}
}
/// Drain the per-thread "figures touched" set, returning the raw handles.
pub fn take_recent_figures() -> Vec<u32> {
#[cfg(feature = "plot-core")]
{
crate::builtins::plotting::take_recent_figures()
.into_iter()
.map(|handle| handle.as_u32())
.collect()
}
#[cfg(not(feature = "plot-core"))]
{
Vec::new()
}
}
/// Record raw figure handles that were touched on another execution thread.
pub fn record_recent_figures(handles: impl IntoIterator<Item = u32>) {
#[cfg(feature = "plot-core")]
{
for handle in handles {
crate::builtins::plotting::record_recent_figure(handle.into());
}
}
#[cfg(not(feature = "plot-core"))]
{
let _ = handles;
}
}