1#![deny(missing_docs)]
18#![warn(clippy::must_use_candidate, clippy::return_self_not_must_use)]
19
20mod annotation;
21#[cfg(feature = "control")]
22#[doc(hidden)]
23pub mod control;
24#[cfg(feature = "semantics")]
25mod hit;
26#[cfg(feature = "semantics")]
27mod recorder;
28#[cfg(feature = "remote")]
29pub mod remote;
30mod semantic;
31mod task;
32mod test_id;
33pub mod time;
34#[cfg(feature = "semantics")]
35#[path = "remote/event.rs"]
36pub mod wire;
37
38pub use annotation::{Annotation, CaretClock, ClickClock, Key, report};
39pub use icedwright_probe_macros::{Messages, TestId};
40pub use icedwright_types::role;
41pub use icedwright_types::{Checked, CursorSeen, Messages, Role, VariantPath};
42pub use semantic::{Semantic, SemanticExt, semantic, test_id};
43#[cfg(feature = "control")]
44pub use task::Named;
45pub use task::{Fallible, NamedTask, TaskName};
46pub use test_id::{IntoTestId, TestId, TestIdRef};
47
48#[cfg(feature = "semantics")]
49pub use annotation::Ask;
50#[cfg(feature = "semantics")]
51pub use hit::{HitProbe, LayerCursor};
52#[cfg(feature = "semantics")]
53pub use recorder::{OverlayMarker, RawRecorder, WindowMarker};
54
55#[doc(hidden)]
57pub mod __private {
58 use std::any::TypeId;
59 use std::collections::BTreeMap;
60 use std::sync::{Mutex, PoisonError};
61
62 pub use std::borrow::Cow;
63 pub use std::sync::LazyLock;
64
65 pub use icedwright_types::VariantPath;
66
67 pub fn variants_for<T: 'static>(
70 build: impl FnOnce() -> Vec<VariantPath>,
71 ) -> &'static [VariantPath] {
72 static TABLES: Mutex<BTreeMap<TypeId, &'static [VariantPath]>> =
73 Mutex::new(BTreeMap::new());
74 let key = TypeId::of::<T>();
75 if let Some(found) = TABLES
76 .lock()
77 .unwrap_or_else(PoisonError::into_inner)
78 .get(&key)
79 {
80 return found;
81 }
82 let built: &'static [VariantPath] = Box::leak(build().into_boxed_slice());
84 TABLES
85 .lock()
86 .unwrap_or_else(PoisonError::into_inner)
87 .entry(key)
88 .or_insert(built)
89 }
90}