pub struct DeviceStatistics {
pub reads_total: u64,
pub writes_total: u64,
pub read_errors: u64,
pub write_errors: u64,
pub ticks_total: u64,
pub avg_tick_duration_us: u64,
pub last_error: Option<String>,
pub uptime_secs: u64,
}Expand description
Device statistics.
Fields§
§reads_total: u64Total read operations.
writes_total: u64Total write operations.
read_errors: u64Read errors.
write_errors: u64Write errors.
ticks_total: u64Total ticks processed.
avg_tick_duration_us: u64Average tick duration in microseconds.
last_error: Option<String>Last error message.
uptime_secs: u64Uptime in seconds.
Implementations§
Source§impl DeviceStatistics
impl DeviceStatistics
Sourcepub fn record_read(&mut self)
pub fn record_read(&mut self)
Record a successful read.
Sourcepub fn record_read_error(&mut self, error: &str)
pub fn record_read_error(&mut self, error: &str)
Record a read error.
Sourcepub fn record_write(&mut self)
pub fn record_write(&mut self)
Record a successful write.
Sourcepub fn record_write_error(&mut self, error: &str)
pub fn record_write_error(&mut self, error: &str)
Record a write error.
Sourcepub fn record_tick(&mut self, duration_us: u64)
pub fn record_tick(&mut self, duration_us: u64)
Record a tick.
Trait Implementations§
Source§impl Clone for DeviceStatistics
impl Clone for DeviceStatistics
Source§fn clone(&self) -> DeviceStatistics
fn clone(&self) -> DeviceStatistics
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 DeviceStatistics
impl Debug for DeviceStatistics
Source§impl Default for DeviceStatistics
impl Default for DeviceStatistics
Source§fn default() -> DeviceStatistics
fn default() -> DeviceStatistics
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for DeviceStatistics
impl<'de> Deserialize<'de> for DeviceStatistics
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<DeviceStatistics, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<DeviceStatistics, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for DeviceStatistics
impl Serialize for DeviceStatistics
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for DeviceStatistics
impl RefUnwindSafe for DeviceStatistics
impl Send for DeviceStatistics
impl Sync for DeviceStatistics
impl Unpin for DeviceStatistics
impl UnsafeUnpin for DeviceStatistics
impl UnwindSafe for DeviceStatistics
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