pub enum BatteryFeature {
Unified(UnifiedBatteryFeature),
Legacy(BatteryStatusFeature),
}Expand description
Unified interface for battery access regardless of feature version.
Variants§
Unified(UnifiedBatteryFeature)
Unified Battery (0x1000) - modern devices.
Legacy(BatteryStatusFeature)
Battery Status (0x1001) - older devices.
Implementations§
Source§impl BatteryFeature
impl BatteryFeature
Sourcepub async fn get_battery(&self, channel: &HidapiChannel) -> Result<BatteryInfo>
pub async fn get_battery(&self, channel: &HidapiChannel) -> Result<BatteryInfo>
Gets the current battery status using the appropriate feature.
§Errors
Returns an error if HID++ communication fails.
Auto Trait Implementations§
impl Freeze for BatteryFeature
impl RefUnwindSafe for BatteryFeature
impl Send for BatteryFeature
impl Sync for BatteryFeature
impl Unpin for BatteryFeature
impl UnwindSafe for BatteryFeature
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more