pub struct CountingDevice { /* private fields */ }Expand description
Wraps a device and counts the reads passing through it.
The counters are atomic and the type is Sync, so a driver reading
from several threads is measured correctly rather than approximately.
Implementations§
Source§impl CountingDevice
impl CountingDevice
Sourcepub fn bytes(&self) -> u64
pub fn bytes(&self) -> u64
How many bytes those calls asked for, including the buffers of reads the device refused.
This is the request, not the transfer. See the module header for
why bytes-moved is not reachable through BlockRead and why
counting the request is what makes two drivers comparable.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for CountingDevice
impl !RefUnwindSafe for CountingDevice
impl !UnwindSafe for CountingDevice
impl Send for CountingDevice
impl Sync for CountingDevice
impl Unpin for CountingDevice
impl UnsafeUnpin for CountingDevice
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