pub struct DelayAcct { /* private fields */ }Expand description
A connected generic-netlink socket bound to the TASKSTATS family.
Linux-only: the generic-netlink ABI has no equivalent on the other unixes this crate compiles for, so the type is absent there rather than present and unusable. The parsing half of this module stays portable so its tests run everywhere.
Implementations§
Source§impl DelayAcct
impl DelayAcct
Sourcepub fn open() -> Option<Self>
pub fn open() -> Option<Self>
Open a socket and resolve the TASKSTATS family.
Returns None when the family does not exist (CONFIG_TASKSTATS=n) or the
socket cannot be created. It does not fail when the caller lacks
CAP_NET_ADMIN: that only shows up on the first read, and is recorded
there.
Sourcepub fn read(&mut self, pid: Pid) -> Option<DelayStats>
pub fn read(&mut self, pid: Pid) -> Option<DelayStats>
Read the delay counters for pid.
None means “not measured”: the process is gone, the kernel refused, or
the reply did not contain a stats blob. Callers must render that as -,
never as zero.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DelayAcct
impl RefUnwindSafe for DelayAcct
impl Send for DelayAcct
impl Sync for DelayAcct
impl Unpin for DelayAcct
impl UnsafeUnpin for DelayAcct
impl UnwindSafe for DelayAcct
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more