pub trait BatteryProvider {
// Required methods
fn new() -> Result<Self>
where Self: Sized;
fn refresh(&mut self) -> Result<()>;
fn info(&self) -> &BatteryInfo;
// Provided method
fn is_supported() -> bool
where Self: Sized { ... }
}Expand description
Trait for platform-specific battery providers.
Required Methods§
Sourcefn info(&self) -> &BatteryInfo
fn info(&self) -> &BatteryInfo
Get the current battery information.
Provided Methods§
Sourcefn is_supported() -> boolwhere
Self: Sized,
fn is_supported() -> boolwhere
Self: Sized,
Check if battery monitoring is supported on this system.