strata-primitives 0.1.0

Zero-dependency mathematical, geometric, color, atom, and memory primitives for Project Strata
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! Runtime Target State (e.g. GUI vs TUI).

use std::sync::atomic::{AtomicBool, Ordering};

static TUI_TARGET_ACTIVE: AtomicBool = AtomicBool::new(false);

/// Checks if the current runtime target is TUI.
pub fn is_tui_target() -> bool {
    TUI_TARGET_ACTIVE.load(Ordering::SeqCst)
}

/// Sets whether the TUI target is active (useful for testing and dual-mode execution).
pub fn set_tui_target_active(active: bool) {
    TUI_TARGET_ACTIVE.store(active, Ordering::SeqCst);
}