lock 0.1.0

Lock your system. Supports macOS, Linux, and Windows.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use ::FailureReason;

#[link(name = "login", kind = "framework")]
extern {
    fn SACLockScreenImmediate();
}

/// Locks macOS system.
pub fn lock_sytem() -> Result<(), FailureReason> {
    unsafe {
        SACLockScreenImmediate();
    }
    Ok(())
}