pub struct System { /* private fields */ }
Expand description
Structs containing system’s information.
Trait Implementations§
source§impl SystemExt for System
impl SystemExt for System
source§const 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 moresource§const 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 moresource§fn 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 moresource§fn refresh_components_list(&mut self)
fn refresh_components_list(&mut self)
Refreshes components list. Read more
source§fn refresh_memory(&mut self)
fn refresh_memory(&mut self)
Refreshes RAM and SWAP usage. Read more
source§fn refresh_cpu_specifics(&mut self, refresh_kind: CpuRefreshKind)
fn refresh_cpu_specifics(&mut self, refresh_kind: CpuRefreshKind)
Refreshes CPUs specific information. Read more
source§fn 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
source§fn 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 moresource§fn refresh_disks_list(&mut self)
fn refresh_disks_list(&mut self)
The disk list will be emptied then completely recomputed. Read more
source§fn refresh_users_list(&mut self)
fn refresh_users_list(&mut self)
Refreshes users list. Read more
source§fn 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 moresource§fn networks_mut(&mut self) -> &mut Networks
fn networks_mut(&mut self) -> &mut Networks
Returns a mutable access to network interfaces. Read more
source§fn global_cpu_info(&self) -> &Cpu
fn global_cpu_info(&self) -> &Cpu
Returns “global” cpus information (aka the addition of all the CPUs). Read more
source§fn 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 moresource§fn total_memory(&self) -> u64
fn total_memory(&self) -> u64
Returns the RAM size in bytes. Read more
source§fn free_memory(&self) -> u64
fn free_memory(&self) -> u64
Returns the amount of free RAM in bytes. Read more
source§fn available_memory(&self) -> u64
fn available_memory(&self) -> u64
Returns the amount of available RAM in bytes. Read more
source§fn used_memory(&self) -> u64
fn used_memory(&self) -> u64
Returns the amount of used RAM in bytes. Read more
source§fn total_swap(&self) -> u64
fn total_swap(&self) -> u64
Returns the SWAP size in bytes. Read more
source§fn components(&self) -> &[Component]
fn components(&self) -> &[Component]
Returns the components list. Read more
source§fn components_mut(&mut self) -> &mut [Component]
fn components_mut(&mut self) -> &mut [Component]
Returns a mutable components list. Read more
source§fn sort_disks_by<F>(&mut self, compare: F)
fn sort_disks_by<F>(&mut self, compare: F)
Sort the disk list with the provided callback. Read more
source§fn boot_time(&self) -> u64
fn boot_time(&self) -> u64
Returns the time (in seconds) when the system booted since UNIX epoch. Read more
source§fn load_average(&self) -> LoadAvg
fn load_average(&self) -> LoadAvg
Returns the system load average value. Read more
source§fn 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
source§fn 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
source§fn distribution_id(&self) -> String
fn distribution_id(&self) -> String
Returns the distribution id as defined by os-release,
or
std::env::consts::OS
. Read moresource§fn new() -> Self
fn new() -> Self
Creates a new
System
instance with nothing loaded. 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 moresource§fn 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 moresource§fn refresh_all(&mut self)
fn refresh_all(&mut self)
Refreshes all system, processes, disks and network interfaces information. Read more
source§fn refresh_system(&mut self)
fn refresh_system(&mut self)
Refreshes system information (RAM, swap, CPU usage and components’ temperature). Read more
source§fn refresh_cpu(&mut self)
fn refresh_cpu(&mut self)
Refreshes CPUs information. Read more
source§fn refresh_components(&mut self)
fn refresh_components(&mut self)
Refreshes components’ temperature. Read more
source§fn refresh_processes(&mut self)
fn refresh_processes(&mut self)
Gets all processes and updates their information. Read more
source§fn 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 moresource§fn refresh_disks(&mut self)
fn refresh_disks(&mut self)
Refreshes the listed disks’ information. Read more
source§fn refresh_networks(&mut self)
fn refresh_networks(&mut self)
Refreshes networks data. Read more
source§fn 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
source§fn 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 moreAuto Trait Implementations§
impl Freeze for System
impl RefUnwindSafe for System
impl Send for System
impl Sync for System
impl Unpin for System
impl UnwindSafe for System
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