pub trait DataSource {
// Required methods
fn poll(&mut self) -> Result<Snapshot, SourceError>;
fn signal_process(
&mut self,
pid: u32,
signal: ProcessSignal,
) -> Result<(), SourceError>;
}Expand description
A producer of snapshots, local or remote.
Required Methods§
Sourcefn poll(&mut self) -> Result<Snapshot, SourceError>
fn poll(&mut self) -> Result<Snapshot, SourceError>
Takes a new measurement.
Rates (CPU %, throughput, power) cover the time since the previous
call, so callers should poll at a steady interval of at least
MIN_POLL_INTERVAL.
Sourcefn signal_process(
&mut self,
pid: u32,
signal: ProcessSignal,
) -> Result<(), SourceError>
fn signal_process( &mut self, pid: u32, signal: ProcessSignal, ) -> Result<(), SourceError>
Sends signal to process pid on the monitored host, with the
privileges of the user the source runs as.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".