#![deny(missing_docs)]
#![warn(clippy::must_use_candidate, clippy::return_self_not_must_use)]
mod annotation;
#[cfg(feature = "control")]
#[doc(hidden)]
pub mod control;
#[cfg(feature = "semantics")]
mod hit;
#[cfg(feature = "semantics")]
mod recorder;
#[cfg(feature = "remote")]
pub mod remote;
mod semantic;
mod task;
mod test_id;
pub mod time;
#[cfg(feature = "semantics")]
#[path = "remote/event.rs"]
pub mod wire;
pub use annotation::{Annotation, CaretClock, ClickClock, Key, report};
pub use icedwright_probe_macros::{Messages, TestId};
pub use icedwright_types::role;
pub use icedwright_types::{Checked, CursorSeen, Messages, Role, VariantPath};
pub use semantic::{Semantic, SemanticExt, semantic, test_id};
#[cfg(feature = "control")]
pub use task::Named;
pub use task::{Fallible, NamedTask, TaskName};
pub use test_id::{IntoTestId, TestId, TestIdRef};
#[cfg(feature = "semantics")]
pub use annotation::Ask;
#[cfg(feature = "semantics")]
pub use hit::{HitProbe, LayerCursor};
#[cfg(feature = "semantics")]
pub use recorder::{OverlayMarker, RawRecorder, WindowMarker};
#[doc(hidden)]
pub mod __private {
use std::any::TypeId;
use std::collections::BTreeMap;
use std::sync::{Mutex, PoisonError};
pub use std::borrow::Cow;
pub use std::sync::LazyLock;
pub use icedwright_types::VariantPath;
pub fn variants_for<T: 'static>(
build: impl FnOnce() -> Vec<VariantPath>,
) -> &'static [VariantPath] {
static TABLES: Mutex<BTreeMap<TypeId, &'static [VariantPath]>> =
Mutex::new(BTreeMap::new());
let key = TypeId::of::<T>();
if let Some(found) = TABLES
.lock()
.unwrap_or_else(PoisonError::into_inner)
.get(&key)
{
return found;
}
let built: &'static [VariantPath] = Box::leak(build().into_boxed_slice());
TABLES
.lock()
.unwrap_or_else(PoisonError::into_inner)
.entry(key)
.or_insert(built)
}
}