nosleep 0.2.0-rc.1

Block power save mode cross platform
Documentation

Cross-platform library to block the power save functionality in the OS.

# use std::error::Error;
# use std::{time::Duration, thread};
# use nosleep::*;
# fn main() -> Result<(), Box<dyn Error>> {
let nosleep = NoSleep::new().unwrap();
let handle = nosleep.start(NoSleepType::PreventUserIdleDisplaySleep)?;
// Depending on the platform, the block will hold
// until either nosleep will be dropped (Linux)
// or the process exits (macOS)
#  Ok(())
# }