Struct sysinfo::System [−][src]
pub struct System { /* fields omitted */ }
Structs containing system’s information.
Trait Implementations
impl Debug for System
[src][+]
fn fmt(&self, f: &mut Formatter<'_>) -> Result
[src][−]
Formats the value using the given formatter. Read more
impl Default for System
[src][+]
fn default() -> System
[src][−]
Returns the “default value” for a type. Read more
impl SystemExt for System
[src][+]
fn new_with_specifics(refreshes: RefreshKind) -> System
[src][−]
Creates a new System
instance and refresh the data corresponding to the
given RefreshKind
. Read more
fn refresh_components_list(&mut self)
[src][−]
Refreshes components list. Read more
fn refresh_memory(&mut self)
[src][−]
Refreshes RAM and SWAP usage. Read more
fn refresh_cpu(&mut self)
[src][−]
Refreshes CPU usage. Read more
fn refresh_processes(&mut self)
[src][−]
Gets all processes and updates their information. Read more
fn refresh_process(&mut self, pid: Pid) -> bool
[src][−]
Refreshes only the process corresponding to pid
. Returns false
if the process doesn’t
exist. If it isn’t listed yet, it’ll be added. Read more
fn refresh_disks_list(&mut self)
[src][−]
The disk list will be emptied then completely recomputed. Read more
fn refresh_users_list(&mut self)
[src][−]
Refreshes users list. Read more
fn get_processes(&self) -> &HashMap<Pid, Process>
[src][−]
Returns the process list. Read more
fn get_process(&self, pid: Pid) -> Option<&Process>
[src][−]
Returns the process corresponding to the given pid or None
if no such process exists. Read more
fn get_networks(&self) -> &Networks
[src][−]
Returns the network interfaces object. Read more
fn get_networks_mut(&mut self) -> &mut Networks
[src][−]
Returns a mutable access to network interfaces. Read more
fn get_global_processor_info(&self) -> &Processor
[src][−]
Returns “global” processors information (aka the addition of all the processors). Read more
fn get_processors(&self) -> &[Processor]
[src][−]
Returns the list of the processors. Read more
fn get_physical_core_count(&self) -> Option<usize>
[src][−]
Returns the number of physical cores on the processor or None
if it couldn’t get it. Read more
fn get_total_memory(&self) -> u64
[src][−]
Returns the RAM size in kB. Read more
fn get_free_memory(&self) -> u64
[src][−]
Returns the amount of free RAM in kB. Read more
fn get_available_memory(&self) -> u64
[src][−]
Returns the amount of available RAM in kB. Read more
fn get_used_memory(&self) -> u64
[src][−]
Returns the amound of used RAM in kB. Read more
fn get_total_swap(&self) -> u64
[src][−]
Returns the SWAP size in kB. Read more
fn get_free_swap(&self) -> u64
[src][−]
Returns the amount of free SWAP in kB. Read more
fn get_used_swap(&self) -> u64
[src][−]
Returns the amount of used SWAP in kB. Read more
fn get_components(&self) -> &[Component]
[src][−]
Returns the components list. Read more
fn get_components_mut(&mut self) -> &mut [Component]
[src][−]
Returns a mutable components list. Read more
fn get_disks(&self) -> &[Disk]
[src][−]
Returns the disks list. Read more
fn get_disks_mut(&mut self) -> &mut [Disk]
[src][−]
Returns the disks list. Read more
fn get_uptime(&self) -> u64
[src][−]
Returns system uptime (in seconds). Read more
fn get_boot_time(&self) -> u64
[src][−]
Returns the time (in seconds) when the system booted since UNIX epoch. Read more
fn get_load_average(&self) -> LoadAvg
[src][−]
Returns the system load average value. Read more
fn get_users(&self) -> &[User]
[src][−]
Returns the users list. Read more
fn get_name(&self) -> Option<String>
[src][−]
Returns the system name. Read more
fn get_long_os_version(&self) -> Option<String>
[src][−]
Returns the system long os version (e.g “MacOS 11.2 BigSur”). Read more
fn get_host_name(&self) -> Option<String>
[src][−]
Returns the system hostname based off DNS Read more
fn get_kernel_version(&self) -> Option<String>
[src][−]
Returns the system’s kernel version. Read more
fn get_os_version(&self) -> Option<String>
[src][−]
Returns the system version (e.g. for MacOS this will return 11.1 rather than the kernel version). Read more
fn new() -> Self
[src][−]
Creates a new System
instance with nothing loaded except the processors 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
fn new_all() -> Self
[src][−]
fn refresh_specifics(&mut self, refreshes: RefreshKind)
[src][−]
Refreshes according to the given RefreshKind
. It calls the corresponding
“refresh_” methods. Read more
fn refresh_system(&mut self)
[src][−]
Refreshes system information (RAM, swap, CPU usage and components’ temperature). Read more
fn refresh_components(&mut self)
[src][−]
Refreshes components’ temperature. Read more
fn refresh_disks(&mut self)
[src][−]
Refreshes the listed disks’ information. Read more
fn refresh_networks(&mut self)
[src][−]
Refreshes networks data. Read more
fn refresh_networks_list(&mut self)
[src][−]
The network list will be updated: removing not existing anymore interfaces and adding new ones. Read more
fn refresh_all(&mut self)
[src][−]
Refreshes all system, processes, disks and network interfaces information. Read more
fn get_process_by_name(&self, name: &str) -> Vec<&Process>
[src][−]
Returns a list 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
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
pub fn type_id(&self) -> TypeId
[src][−]
Gets the TypeId
of self
. Read more
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
pub fn borrow(&self) -> &T
[src][−]
Immutably borrows from an owned value. Read more
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src][−]
Mutably borrows from an owned value. Read more
impl<T> From<T> for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T> Pointable for T
[src][+]
pub const ALIGN: usize
[src][−][−]
The alignment of pointer.
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
[src][−]
Initializes a with the given initializer. Read more
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
[src][−]
Dereferences the given pointer. Read more
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
[src][−]
Mutably dereferences the given pointer. Read more
pub unsafe fn drop(ptr: usize)
[src][−]
Drops the object pointed to by the given pointer. Read more
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][−]
Performs the conversion.
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,