zoi-rs 1.7.0

Universal Package Manager & Environment Setup Tool
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use std::sync::OnceLock;

static OFFLINE_MODE: OnceLock<bool> = OnceLock::new();

/// Sets the global offline mode.
pub fn set_offline(offline: bool) {
    let _ = OFFLINE_MODE.set(offline);
}

/// Returns true if Zoi is in offline mode.
pub fn is_offline() -> bool {
    *OFFLINE_MODE.get().unwrap_or(&false)
}