Struct proc_status::ProcStatus [−][src]
A snapshot of the status of a process
It’s stored in a string to ensure consistency and can be kept around and compared.
Implementations
impl ProcStatus
[src]
pub fn read() -> Result<Self, ProcStatusError>
[src]
read the proc status info of the current process.
It’s the same than ProcStatus::read(ProcRef::ProcSelf)
pub fn read_for(proc_ref: ProcRef) -> Result<Self, ProcStatusError>
[src]
read the proc status info of a process.
pub fn entries(&self) -> ProcEntries<'_>ⓘNotable traits for ProcEntries<'p>
impl<'p> Iterator for ProcEntries<'p> type Item = Result<ProcEntry<'p>, ProcStatusError>;
[src]
Notable traits for ProcEntries<'p>
impl<'p> Iterator for ProcEntries<'p> type Item = Result<ProcEntry<'p>, ProcStatusError>;
return an iterator over all key:value entries
pub fn entry(&self, key: &str) -> Result<ProcEntry<'_>, ProcStatusError>
[src]
find an entry by name
pub fn value(&self, key: &str) -> Result<&str, ProcStatusError>
[src]
return the value of an entry found by key
Example:
println!( "current process name: {:?}", proc_status::ProcStatus::read().unwrap().value("Name").unwrap(), );
Be careful that the values written as “xxx kB” are in KiB, not kB, and are written this way for compatibility.
pub fn value_KiB(&self, key: &str) -> Result<usize, ProcStatusError>
[src]
return the value of a memory related entry in KiB
pub fn mem_usage(&self) -> Result<MemUsage, ProcStatusError>
[src]
return the current and peak ram usage of the process
Auto Trait Implementations
impl RefUnwindSafe for ProcStatus
impl Send for ProcStatus
impl Sync for ProcStatus
impl Unpin for ProcStatus
impl UnwindSafe for ProcStatus
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,