pub struct System { /* private fields */ }
Expand description
Structs containing system’s information.
Trait Implementations
sourceimpl SystemExt for System
impl SystemExt for System
sourceconst IS_SUPPORTED: bool = true
const IS_SUPPORTED: bool = true
Returns true
if this OS is supported. Please refer to the
crate-level documentation to get the list of supported OSes. Read more
sourceconst SUPPORTED_SIGNALS: &'static [Signal] = _
const SUPPORTED_SIGNALS: &'static [Signal] = _
Returns the list of the supported signals on this system (used by
ProcessExt::kill_with
). Read more
sourcefn new_with_specifics(refreshes: RefreshKind) -> System
fn new_with_specifics(refreshes: RefreshKind) -> System
Creates a new System
instance and refresh the data corresponding to the
given RefreshKind
. Read more
sourcefn refresh_components_list(&mut self)
fn refresh_components_list(&mut self)
Refreshes components list. Read more
sourcefn refresh_memory(&mut self)
fn refresh_memory(&mut self)
Refreshes RAM and SWAP usage. Read more
sourcefn refresh_cpu_specifics(&mut self, refresh_kind: CpuRefreshKind)
fn refresh_cpu_specifics(&mut self, refresh_kind: CpuRefreshKind)
Refreshes CPUs specific information. Read more
sourcefn refresh_processes_specifics(&mut self, refresh_kind: ProcessRefreshKind)
fn refresh_processes_specifics(&mut self, refresh_kind: ProcessRefreshKind)
Gets all processes and updates the specified information. Read more
sourcefn refresh_process_specifics(
&mut self,
pid: Pid,
refresh_kind: ProcessRefreshKind
) -> bool
fn refresh_process_specifics(
&mut self,
pid: Pid,
refresh_kind: ProcessRefreshKind
) -> bool
Refreshes only the process corresponding to pid
. Returns false
if the process doesn’t
exist (it will NOT be removed from the processes if it doesn’t exist anymore). If it
isn’t listed yet, it’ll be added. Read more
sourcefn refresh_disks_list(&mut self)
fn refresh_disks_list(&mut self)
The disk list will be emptied then completely recomputed. Read more
sourcefn refresh_users_list(&mut self)
fn refresh_users_list(&mut self)
Refreshes users list. Read more
sourcefn process(&self, pid: Pid) -> Option<&Process>
fn process(&self, pid: Pid) -> Option<&Process>
Returns the process corresponding to the given pid or None
if no such process exists. Read more
sourcefn networks_mut(&mut self) -> &mut Networks
fn networks_mut(&mut self) -> &mut Networks
Returns a mutable access to network interfaces. Read more
sourcefn global_cpu_info(&self) -> &Cpu
fn global_cpu_info(&self) -> &Cpu
Returns “global” cpus information (aka the addition of all the CPUs). Read more
sourcefn physical_core_count(&self) -> Option<usize>
fn physical_core_count(&self) -> Option<usize>
Returns the number of physical cores on the CPU or None
if it couldn’t get it. Read more
sourcefn total_memory(&self) -> u64
fn total_memory(&self) -> u64
Returns the RAM size in KB. Read more
sourcefn free_memory(&self) -> u64
fn free_memory(&self) -> u64
Returns the amount of free RAM in KB. Read more
sourcefn available_memory(&self) -> u64
fn available_memory(&self) -> u64
Returns the amount of available RAM in KB. Read more
sourcefn used_memory(&self) -> u64
fn used_memory(&self) -> u64
Returns the amount of used RAM in KB. Read more
sourcefn total_swap(&self) -> u64
fn total_swap(&self) -> u64
Returns the SWAP size in KB. Read more
sourcefn components(&self) -> &[Component]
fn components(&self) -> &[Component]
Returns the components list. Read more
sourcefn components_mut(&mut self) -> &mut [Component]
fn components_mut(&mut self) -> &mut [Component]
Returns a mutable components list. Read more
sourcefn boot_time(&self) -> u64
fn boot_time(&self) -> u64
Returns the time (in seconds) when the system booted since UNIX epoch. Read more
sourcefn load_average(&self) -> LoadAvg
fn load_average(&self) -> LoadAvg
Returns the system load average value. Read more
sourcefn long_os_version(&self) -> Option<String>
fn long_os_version(&self) -> Option<String>
Returns the system long os version (e.g “MacOS 11.2 BigSur”). Read more
sourcefn kernel_version(&self) -> Option<String>
fn kernel_version(&self) -> Option<String>
Returns the system’s kernel version. Read more
sourcefn os_version(&self) -> Option<String>
fn os_version(&self) -> Option<String>
Returns the system version (e.g. for MacOS this will return 11.1 rather than the kernel version). Read more
sourcefn new() -> Self
fn new() -> Self
Creates a new System
instance with nothing loaded except the cpus list. If you
want to load components, network interfaces or the disks, you’ll have to use the
refresh_*_list
methods. SystemExt::refresh_networks_list
for example. Read more
sourcefn refresh_specifics(&mut self, refreshes: RefreshKind)
fn refresh_specifics(&mut self, refreshes: RefreshKind)
Refreshes according to the given RefreshKind
. It calls the corresponding
“refresh_” methods. Read more
sourcefn refresh_all(&mut self)
fn refresh_all(&mut self)
Refreshes all system, processes, disks and network interfaces information. Read more
sourcefn refresh_system(&mut self)
fn refresh_system(&mut self)
Refreshes system information (RAM, swap, CPU usage and components’ temperature). Read more
sourcefn refresh_cpu(&mut self)
fn refresh_cpu(&mut self)
Refreshes CPUs information. Read more
sourcefn refresh_components(&mut self)
fn refresh_components(&mut self)
Refreshes components’ temperature. Read more
sourcefn refresh_processes(&mut self)
fn refresh_processes(&mut self)
Gets all processes and updates their information. Read more
sourcefn refresh_process(&mut self, pid: Pid) -> bool
fn refresh_process(&mut self, pid: Pid) -> bool
Refreshes only the process corresponding to pid
. Returns false
if the process doesn’t
exist (it will NOT be removed from the processes if it doesn’t exist anymore). If it
isn’t listed yet, it’ll be added. Read more
sourcefn refresh_disks(&mut self)
fn refresh_disks(&mut self)
Refreshes the listed disks’ information. Read more
sourcefn refresh_networks(&mut self)
fn refresh_networks(&mut self)
Refreshes networks data. Read more
sourcefn refresh_networks_list(&mut self)
fn refresh_networks_list(&mut self)
The network list will be updated: removing not existing anymore interfaces and adding new ones. Read more
sourcefn processes_by_name<'a>(
&'a self,
name: &'a str
) -> Box<dyn Iterator<Item = &'a Process> + 'a>
fn processes_by_name<'a>(
&'a self,
name: &'a str
) -> Box<dyn Iterator<Item = &'a Process> + 'a>
Returns an iterator of process containing the given name
. Read more
Auto Trait Implementations
impl RefUnwindSafe for System
impl Send for System
impl Sync for System
impl Unpin for System
impl UnwindSafe for System
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more