pub struct Process {
pub pid: u32,
pub pname: String,
}Expand description
the process struct .
use tasklist::Process;
let p = Process::new(123,"yeah.exe".to_string());Fields§
§pid: u32§pname: StringImplementations§
Source§impl Process
impl Process
Sourcepub fn new(pid: u32, pname: String) -> Process
pub fn new(pid: u32, pname: String) -> Process
new a process struct
use tasklist::Process;
let p = Process::new(123,"yeah.exe".to_string());Sourcepub fn get_sid(&self) -> Result<String, String>
pub fn get_sid(&self) -> Result<String, String>
get the process SID . return Result<String,String>
Sourcepub fn get_user(&self) -> Result<String, String>
pub fn get_user(&self) -> Result<String, String>
get the process User . return Result<String,String>
Sourcepub fn get_threads(&self) -> Result<Vec<u32>, String>
pub fn get_threads(&self) -> Result<Vec<u32>, String>
get the process threadsID . return Result<Vec<u32>,String>
Sourcepub fn get_path(&self) -> Result<String, String>
pub fn get_path(&self) -> Result<String, String>
get the process path . return Result<String, String>
Sourcepub fn get_parrent(&self) -> Option<u32>
pub fn get_parrent(&self) -> Option<u32>
get the process parrentID , return Option<u32>
Sourcepub fn get_start_time(&self) -> Result<String, String>
pub fn get_start_time(&self) -> Result<String, String>
get the process start time . return Result<String,String>
Sourcepub fn get_exit_time(&self) -> Result<String, String>
pub fn get_exit_time(&self) -> Result<String, String>
get process exit time . return Result<String,String>
Sourcepub fn get_cpu_time(&self) -> Result<CpuTime, String>
pub fn get_cpu_time(&self) -> Result<CpuTime, String>
get process cpu time infomation . return Result<CpuTime,String>
Sourcepub fn get_cmd_params(&self) -> Result<String, String>
pub fn get_cmd_params(&self) -> Result<String, String>
get process commandline params . return Result<String,String>
Sourcepub fn get_io_counter(&self) -> IoCounter
pub fn get_io_counter(&self) -> IoCounter
get process io counter . return a IoCounter struct
Sourcepub fn get_memory_info(&self) -> MemoryCounter
pub fn get_memory_info(&self) -> MemoryCounter
get process memory counter . return a MemoryCounter struct
Sourcepub fn get_handles_counter(&self) -> Result<u32, String>
pub fn get_handles_counter(&self) -> Result<u32, String>
get process handle counter
Sourcepub fn get_file_info(&self) -> Result<HashMap<String, String>, String>
pub fn get_file_info(&self) -> Result<HashMap<String, String>, String>
get the file info of the process . use GetFileVersionInfoExW api . it will return a HashMap<String,String> including a lot of infomation.
you can get value throught CompanyName FileDescription OriginalFilename ProductName ProductVersion PrivateBuild InternalName LegalCopyright FileVersion keys.
Sourcepub fn is_wow64(&self) -> Option<bool>
pub fn is_wow64(&self) -> Option<bool>
Check if process is running under WOW64 Returns None if failed to get information
Sourcepub fn get_architecture_info(
&self,
) -> Option<(bool, &'static str, &'static str)>
pub fn get_architecture_info( &self, ) -> Option<(bool, &'static str, &'static str)>
Get process architecture information Returns tuple: (is_wow64: bool, process_arch: &str, native_arch: &str) Returns None if failed to get information
Sourcepub fn get_file_info_item(&self, key: &str) -> Option<String>
pub fn get_file_info_item(&self, key: &str) -> Option<String>
Get specific file info item by key Returns None if key doesn’t exist
Sourcepub fn get_company_name(&self) -> Option<String>
pub fn get_company_name(&self) -> Option<String>
Get company name from file info
Sourcepub fn get_file_description(&self) -> Option<String>
pub fn get_file_description(&self) -> Option<String>
Get file description from file info
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Check if process is still running