macOS library to block the power save function and preventing the OS to sleep.
# Cargo.toml
[dependencies]
nosleep-mac-sys = "0.1.0"
The documentation can be found here.
use nosleep_mac_sys::*;
let handle = start(NoSleepType::PreventUserIdleSystemSleep);
if let Some(handle) = handle {
println!("Block is active with handle {}", handle);
stop(handle);
println!("Block is deactivated");
}