#[cfg(target_os = "linux")]
#[path = "linux.rs"]
mod os;
#[cfg(target_os = "macos")]
#[path = "macos.rs"]
mod os;
#[cfg(target_os = "macos")]
pub use os::request_permission_dialog;
#[cfg(target_os = "windows")]
#[path = "windows.rs"]
mod os;
#[cfg(target_os = "windows")]
pub use os::{reboot_with_message, shutdown_with_message};
use std::io;
#[doc(hidden)]
#[macro_export]
macro_rules! not_implemented {
() => {
Err(std::io::Error::new(
std::io::ErrorKind::Other,
"feature not implemented yet",
))
};
}
pub type ShutdownResult = io::Result<()>;
pub fn shutdown() -> ShutdownResult {
os::shutdown()
}
pub fn force_shutdown() -> ShutdownResult {
os::force_shutdown()
}
pub fn reboot() -> ShutdownResult {
os::reboot()
}
pub fn force_reboot() -> ShutdownResult {
os::force_reboot()
}
pub fn logout() -> ShutdownResult {
os::logout()
}
pub fn force_logout() -> ShutdownResult {
os::force_logout()
}
pub fn sleep() -> ShutdownResult {
os::sleep()
}
pub fn hibernate() -> ShutdownResult {
os::hibernate()
}