pub struct DeviceStats {
pub device_id: u32,
pub address: String,
pub comm_stats: CommunicationStats,
pub last_seen: Option<Instant>,
pub response_times_ms: Vec<f64>,
pub online: bool,
}Expand description
Device-specific statistics
Fields§
§device_id: u32§address: String§comm_stats: CommunicationStats§last_seen: Option<Instant>§response_times_ms: Vec<f64>§online: boolImplementations§
Source§impl DeviceStats
impl DeviceStats
Sourcepub fn record_response_time(&mut self, ms: f64)
pub fn record_response_time(&mut self, ms: f64)
Record a response time
Sourcepub fn avg_response_time(&self) -> Option<f64>
pub fn avg_response_time(&self) -> Option<f64>
Get average response time
Sourcepub fn mark_offline(&mut self)
pub fn mark_offline(&mut self)
Mark device as offline
Trait Implementations§
Source§impl Clone for DeviceStats
impl Clone for DeviceStats
Source§fn clone(&self) -> DeviceStats
fn clone(&self) -> DeviceStats
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 moreAuto Trait Implementations§
impl Freeze for DeviceStats
impl RefUnwindSafe for DeviceStats
impl Send for DeviceStats
impl Sync for DeviceStats
impl Unpin for DeviceStats
impl UnsafeUnpin for DeviceStats
impl UnwindSafe for DeviceStats
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