pub enum HealthStatus {
Good,
Cold,
Cool,
Warm,
Hot,
Dead,
OverVoltage,
UnspecifiedFailure,
// some variants omitted
}Expand description
Battery health and safety status, including JEITA temperature regions and fault conditions.
Each value describes whether the pack may be charged and whether it can still supply power to the system. Unless a value states otherwise, the battery can still supply power.
Variants§
Good
Normal operating temperature and healthy battery condition. Both charging and discharging are permitted.
Cold
Battery temperature is below safe charging threshold (charging prohibited). The battery can still supply power, though available capacity and peak current are typically reduced.
Cool
Battery temperature is low (charging current or voltage may be restricted). The battery can still supply power.
Warm
Battery temperature is elevated (charging current or voltage may be restricted). The battery can still supply power.
Hot
Battery temperature exceeded safety threshold (charging prohibited). The battery can usually still supply power, but hardware protection may open the discharge path if the temperature continues to rise.
Dead
Battery pack voltage is below operating threshold or cell is dead. The battery cannot supply usable power to the system.
OverVoltage
Battery voltage exceeded hardware safety limit (charging prohibited). The battery can still supply power; discharging is the expected recovery path.
UnspecifiedFailure
Unspecified hardware or fuel gauge safety fault. Whether the pack may be charged, or can supply power at all, is indeterminate.
Implementations§
Source§impl HealthStatus
impl HealthStatus
pub fn from_primitive(prim: u32) -> Option<Self>
pub fn from_primitive_allow_unknown(prim: u32) -> Self
pub fn unknown() -> Self
pub const fn into_primitive(self) -> u32
pub fn is_unknown(&self) -> bool
Trait Implementations§
Source§impl Clone for HealthStatus
impl Clone for HealthStatus
Source§fn clone(&self) -> HealthStatus
fn clone(&self) -> HealthStatus
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for HealthStatus
Source§impl Debug for HealthStatus
impl Debug for HealthStatus
Source§impl<D: ResourceDialect> Decode<HealthStatus, D> for HealthStatus
impl<D: ResourceDialect> Decode<HealthStatus, D> for HealthStatus
Source§impl<D: ResourceDialect> Encode<HealthStatus, D> for HealthStatus
impl<D: ResourceDialect> Encode<HealthStatus, D> for HealthStatus
impl Eq for HealthStatus
Source§impl Hash for HealthStatus
impl Hash for HealthStatus
Source§impl Ord for HealthStatus
impl Ord for HealthStatus
Source§fn cmp(&self, other: &HealthStatus) -> Ordering
fn cmp(&self, other: &HealthStatus) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for HealthStatus
impl PartialEq for HealthStatus
Source§impl PartialOrd for HealthStatus
impl PartialOrd for HealthStatus
impl StructuralPartialEq for HealthStatus
Source§impl TypeMarker for HealthStatus
impl TypeMarker for HealthStatus
Source§type Owned = HealthStatus
type Owned = HealthStatus
Source§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
Source§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
inline_align.Source§fn encode_is_copy() -> bool
fn encode_is_copy() -> bool
Self::Owned matches the FIDL wire
format and encoding requires no validation. When true, we can optimize
encoding arrays and vectors of Self::Owned to a single memcpy. Read moreSource§fn decode_is_copy() -> bool
fn decode_is_copy() -> bool
Self::Owned matches the FIDL wire
format and decoding requires no validation. When true, we can optimize
decoding arrays and vectors of Self::Owned to a single memcpy.Source§impl ValueTypeMarker for HealthStatus
impl ValueTypeMarker for HealthStatus
Source§type Borrowed<'a> = HealthStatus
type Borrowed<'a> = HealthStatus
Encode<Self>
type cheaply obtainable from &Self::Owned. There are three cases: Read more