procfs_core/process/
schedstat.rsuse crate::from_iter;
use crate::ProcResult;
use std::io::Read;
#[cfg(feature = "serde1")]
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone)]
#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
pub struct Schedstat {
pub sum_exec_runtime: u64,
pub run_delay: u64,
pub pcount: u64,
}
impl crate::FromRead for Schedstat {
fn from_read<R: Read>(mut r: R) -> ProcResult<Self> {
let mut line = String::new();
r.read_to_string(&mut line)?;
let mut s = line.split_whitespace();
let schedstat = Schedstat {
sum_exec_runtime: expect!(from_iter(&mut s)),
run_delay: expect!(from_iter(&mut s)),
pcount: expect!(from_iter(&mut s)),
};
if cfg!(test) {
assert!(s.next().is_none());
}
Ok(schedstat)
}
}