pub struct DeviceState {Show 15 fields
pub id: String,
pub name: Option<String>,
pub alias: Option<String>,
pub device_type: Option<DeviceType>,
pub reading: Option<CurrentReading>,
pub history: Vec<HistoryRecord>,
pub status: ConnectionStatus,
pub last_updated: Option<Instant>,
pub error: Option<String>,
pub previous_reading: Option<CurrentReading>,
pub session_stats: SessionStats,
pub last_sync: Option<OffsetDateTime>,
pub rssi: Option<i16>,
pub connected_at: Option<Instant>,
pub settings: Option<DeviceSettings>,
}Expand description
State for a single Aranet device.
Fields§
§id: StringUnique device identifier.
name: Option<String>Device name if known.
alias: Option<String>User-defined alias for the device.
device_type: Option<DeviceType>Device type if detected.
reading: Option<CurrentReading>Most recent sensor reading.
history: Vec<HistoryRecord>Historical readings for sparkline display.
status: ConnectionStatusCurrent connection status.
last_updated: Option<Instant>When the device state was last updated.
error: Option<String>Error message if an error occurred.
previous_reading: Option<CurrentReading>Previous reading for trend calculation.
session_stats: SessionStatsSession statistics for this device.
last_sync: Option<OffsetDateTime>When history was last synced from the device.
rssi: Option<i16>RSSI signal strength (dBm) if available.
connected_at: Option<Instant>When the device was connected (for uptime calculation).
settings: Option<DeviceSettings>Device settings read from the device.
Implementations§
Trait Implementations§
Source§impl Clone for DeviceState
impl Clone for DeviceState
Source§fn clone(&self) -> DeviceState
fn clone(&self) -> DeviceState
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 moreAuto Trait Implementations§
impl Freeze for DeviceState
impl RefUnwindSafe for DeviceState
impl Send for DeviceState
impl Sync for DeviceState
impl Unpin for DeviceState
impl UnwindSafe for DeviceState
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> 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