pub fn on_ac() -> Result<Option<bool>>
Whether the machine runs on mains power; None when it cannot be told, which is the answer on a desktop with no power information.
None
As battery.
battery