Native power and idle state queries for MoonBit on Windows, Linux, and macOS.
let monitor = @power_monitor.PowerMonitor()
defer monitor.destroy()
monitor.with_watching(() => {
// Use monitor.drain_events() from the application's event loop.
// Keep this scope alive until the owning task is cancelled.
@async.pause()
})pub(all) suberror PowerMonitorError {
BackendUnavailable(detail~ : String)
OperationFailed(operation~ : String, detail~ : String)
} derive(Eq)impl Show for PowerMonitorErrorpub struct PowerMonitor {
// private fields
}Install
Download zipNative power and idle state queries for MoonBit on Windows, Linux, and macOS.