pub struct Watched {
pub target: ProcTarget,
/* private fields */
}Expand description
A watched process between samples: the process it was last found as, and that process’s counters then.
Fields§
§target: ProcTargetImplementations§
Source§impl Watched
impl Watched
pub fn new(target: ProcTarget) -> Self
Sourcepub fn sample(
&mut self,
dt_s: f64,
units: (f64, f64),
missing: &mut dyn FnMut(&str),
) -> Option<ProcReading>
pub fn sample( &mut self, dt_s: f64, units: (f64, f64), missing: &mut dyn FnMut(&str), ) -> Option<ProcReading>
Read the process now and return its reading for the window
since the last read. None for the first window of a process,
which has nothing to take a difference against, and while the
process is not there; missing is called once each time it
goes missing.
Auto Trait Implementations§
impl Forget for Watched
impl Freeze for Watched
impl Move for Watched
impl RefUnwindSafe for Watched
impl Send for Watchedwhere
RawVecInner: Send,
impl Sync for Watchedwhere
RawVecInner: Sync,
impl Unpin for Watched
impl UnsafeUnpin for Watched
impl UnwindSafe for Watchedwhere
RawVecInner: UnwindSafe,
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