use core::future::Future;
pub use embedded_batteries::charger::{Error, ErrorKind, ErrorType};
pub use embedded_batteries::{MilliAmps, MilliVolts};
pub trait Charger: ErrorType {
fn charging_current(&mut self, current: MilliAmps) -> impl Future<Output = Result<MilliAmps, Self::Error>>;
fn charging_voltage(&mut self, voltage: MilliVolts) -> impl Future<Output = Result<MilliVolts, Self::Error>>;
}
impl<T: Charger + ?Sized> Charger for &mut T {
#[inline]
async fn charging_current(&mut self, current: MilliAmps) -> Result<MilliAmps, Self::Error> {
T::charging_current(self, current).await
}
#[inline]
async fn charging_voltage(&mut self, voltage: MilliVolts) -> Result<MilliVolts, Self::Error> {
T::charging_voltage(self, voltage).await
}
}