pub struct FileReadCounter { /* private fields */ }Expand description
The bytes read from one file through file-backed
Bytes while this counter is alive.
A file-backed allocation reads its file only when it is first accessed —
most often when a runtime copies it to a device, on the runtime’s own
thread — so whoever made the allocation does not see the read happen. A
counter is how they learn how far it has got: create one for the file
before its bytes are read, then read read from any thread.
The file is matched by the path Bytes::from_file
was given, compared as given and never canonicalized. Two counters of one
file each count every read of it.
Implementations§
Trait Implementations§
Source§impl Drop for FileReadCounter
impl Drop for FileReadCounter
Auto Trait Implementations§
impl Freeze for FileReadCounter
impl RefUnwindSafe for FileReadCounter
impl Send for FileReadCounter
impl Sync for FileReadCounter
impl Unpin for FileReadCounter
impl UnsafeUnpin for FileReadCounter
impl UnwindSafe for FileReadCounter
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