sinf 0.1.0

Library for obtaining in-depth system information at both the hardware and software levels
Documentation
mod accessors;
mod cpu;
mod disk;
#[cfg(feature = "gpu")]
mod gpu;
mod handle;
mod inner;
mod lifecycle;
mod params;
mod times;
mod user;

use std::ffi::OsString;
use std::fmt;
use std::path::PathBuf;
use std::sync::Arc;

use crate::sys::utils::HandleWrapper;
use crate::{Pid, ProcessStatus};

use self::cpu::CPUsageCalculationValues;
#[cfg(feature = "gpu")]
use self::gpu::GpuInfo;

impl fmt::Display for ProcessStatus {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        f.write_str(match *self {
            ProcessStatus::Run => "Runnable",
            _ => "Unknown",
        })
    }
}

pub(crate) struct ProcessInner {
    name: OsString,
    cmd: Vec<OsString>,
    exe: Option<PathBuf>,
    pid: Pid,
    user_id: Option<crate::Uid>,
    environ: Vec<OsString>,
    cwd: Option<PathBuf>,
    root: Option<PathBuf>,
    pub(crate) memory: u64,
    pub(crate) virtual_memory: u64,
    pub(crate) parent: Option<Pid>,
    status: ProcessStatus,
    handle: Option<Arc<HandleWrapper>>,
    cpu_calc_values: CPUsageCalculationValues,
    start_time: u64,
    pub(crate) run_time: u64,
    cpu_usage: f32,
    pub(crate) updated: bool,
    old_read_bytes: u64,
    old_written_bytes: u64,
    read_bytes: u64,
    written_bytes: u64,
    accumulated_cpu_time: u64,
    exists: bool,
    #[cfg(feature = "gpu")]
    gpu_info: GpuInfo,
}

pub(crate) fn get_executable_path(_pid: Pid) -> Option<PathBuf> {
    None
}