pub struct HealthStatus {
pub battery_percent: u8,
pub heart_rate: Option<u8>,
pub activity: u8,
pub alerts: u8,
}Expand description
Health status data with LWW semantics
Fields§
§battery_percent: u8Battery percentage (0-100)
heart_rate: Option<u8>Heart rate BPM (optional)
activity: u8Activity level (0=still, 1=walking, 2=running, 3=vehicle)
alerts: u8Alert status flags
Implementations§
Source§impl HealthStatus
impl HealthStatus
Sourcepub const ALERT_MAN_DOWN: u8 = 1u8
pub const ALERT_MAN_DOWN: u8 = 1u8
Alert flag: Man down
Sourcepub const ALERT_LOW_BATTERY: u8 = 2u8
pub const ALERT_LOW_BATTERY: u8 = 2u8
Alert flag: Low battery
Sourcepub const ALERT_OUT_OF_RANGE: u8 = 4u8
pub const ALERT_OUT_OF_RANGE: u8 = 4u8
Alert flag: Out of range
Sourcepub const ALERT_CUSTOM_1: u8 = 8u8
pub const ALERT_CUSTOM_1: u8 = 8u8
Alert flag: Custom alert 1
Sourcepub fn with_heart_rate(self, hr: u8) -> Self
pub fn with_heart_rate(self, hr: u8) -> Self
Set heart rate
Sourcepub fn with_activity(self, activity: u8) -> Self
pub fn with_activity(self, activity: u8) -> Self
Set activity level
Sourcepub fn clear_alert(&mut self, flag: u8)
pub fn clear_alert(&mut self, flag: u8)
Clear alert flag
Trait Implementations§
Source§impl Clone for HealthStatus
impl Clone for HealthStatus
Source§fn clone(&self) -> HealthStatus
fn clone(&self) -> HealthStatus
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HealthStatus
impl Debug for HealthStatus
Source§impl Default for HealthStatus
impl Default for HealthStatus
Source§fn default() -> HealthStatus
fn default() -> HealthStatus
Returns the “default value” for a type. Read more
Source§impl PartialEq for HealthStatus
impl PartialEq for HealthStatus
impl StructuralPartialEq for HealthStatus
Auto Trait Implementations§
impl Freeze for HealthStatus
impl RefUnwindSafe for HealthStatus
impl Send for HealthStatus
impl Sync for HealthStatus
impl Unpin for HealthStatus
impl UnwindSafe for HealthStatus
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