pub struct DeviceCapabilitySnapshot {
pub timestamp_ms: i64,
pub battery_level: Option<u8>,
pub is_charging: bool,
pub relay_role: RelayRole,
pub changed_fields: u8,
}Expand description
Snapshot of local device capability at the moment of emission.
The changed_fields bitmask identifies which fields triggered emission —
sinks can filter on a specific bit to ignore unrelated churn.
Fields§
§timestamp_ms: i64Emission timestamp (milliseconds since Unix epoch).
battery_level: Option<u8>Current battery level (0-100), or None if unknown.
is_charging: boolWhether the device is charging.
relay_role: RelayRoleCurrent relay role (regular or relay).
changed_fields: u8Bitmask of the fields that triggered this emission.
Implementations§
Source§impl DeviceCapabilitySnapshot
impl DeviceCapabilitySnapshot
Sourcepub const NAME: &'static str = "protocol.device.capability_changed"
pub const NAME: &'static str = "protocol.device.capability_changed"
Stable OTel-friendly name for this record.
Sourcepub fn telemetry_name(&self) -> &'static str
pub fn telemetry_name(&self) -> &'static str
Returns the stable telemetry name.
Sourcepub fn has_changed(&self, bit: u8) -> bool
pub fn has_changed(&self, bit: u8) -> bool
Returns true when the given change bit is set.
Trait Implementations§
Source§impl Clone for DeviceCapabilitySnapshot
impl Clone for DeviceCapabilitySnapshot
Source§fn clone(&self) -> DeviceCapabilitySnapshot
fn clone(&self) -> DeviceCapabilitySnapshot
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for DeviceCapabilitySnapshot
Source§impl Debug for DeviceCapabilitySnapshot
impl Debug for DeviceCapabilitySnapshot
impl Eq for DeviceCapabilitySnapshot
Source§impl PartialEq for DeviceCapabilitySnapshot
impl PartialEq for DeviceCapabilitySnapshot
impl StructuralPartialEq for DeviceCapabilitySnapshot
Auto Trait Implementations§
impl Freeze for DeviceCapabilitySnapshot
impl RefUnwindSafe for DeviceCapabilitySnapshot
impl Send for DeviceCapabilitySnapshot
impl Sync for DeviceCapabilitySnapshot
impl Unpin for DeviceCapabilitySnapshot
impl UnsafeUnpin for DeviceCapabilitySnapshot
impl UnwindSafe for DeviceCapabilitySnapshot
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Declassify for T
impl<T> Declassify for T
type Declassified = T
fn declassify(self) -> T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more