Struct tauri_utils::​process::​System

pub struct System { /* fields omitted */ }

Structs containing system's information.

Trait Implementations

impl Debug for System

fn fmt(&self, f: &mut Formatter) -> Result<(), Error>

Formats the value using the given formatter. Read more

impl Default for System

fn default() -> System

Returns the "default value" for a type. Read more

impl SystemExt for System

fn new_with_specifics(refreshes: RefreshKind) -> System

Creates a new [System] instance and refresh the data corresponding to the given [RefreshKind]. Read more

fn refresh_memory(&mut self)

Refresh RAM and SWAP usage.

fn refresh_cpu(&mut self)

Refresh CPU usage.

fn refresh_temperatures(&mut self)

Refresh components' temperature.

fn refresh_processes(&mut self)

Get all processes and update their information.

fn refresh_process(&mut self, pid: i32) -> bool

Refresh only the process corresponding to pid. Returns false if the process doesn't exist. Read more

fn refresh_disks(&mut self)

Refreshes the listed disks' information.

fn refresh_disk_list(&mut self)

The disk list will be emptied then completely recomputed.

fn refresh_network(&mut self)

Refresh data network.

fn get_process_list(&self) -> &HashMap<i32, Process, RandomState>

Returns the process list.

fn get_process(&self, pid: i32) -> Option<&Process>

Returns the process corresponding to the given pid or None if no such process exists.

fn get_network(&self) -> &NetworkData

Returns network data.

fn get_processor_list(&self) -> &[Processor]

The first processor in the array is the "main" one (aka the addition of all the others).

fn get_total_memory(&self) -> u64

Returns total RAM size in KiB.

fn get_free_memory(&self) -> u64

Returns free RAM size in KiB.

fn get_used_memory(&self) -> u64

Returns used RAM size in KiB.

fn get_total_swap(&self) -> u64

Returns SWAP size in KiB.

fn get_free_swap(&self) -> u64

Returns free SWAP size in KiB.

fn get_used_swap(&self) -> u64

Returns used SWAP size in KiB.

fn get_components_list(&self) -> &[Component]

Returns components list.

fn get_disks(&self) -> &[Disk]

Returns disks' list.

fn get_uptime(&self) -> u64

Returns system uptime.

fn new() -> Self

Creates a new [System] instance. It only contains the disks' list and the processes list at this stage. Use the [refresh_all] method to update its internal information (or any of the refresh_ method). Read more

fn refresh_specifics(&mut self, refreshes: RefreshKind)

Refreshes according to the given [RefreshKind]. It calls the corresponding "refresh_" methods. Read more

fn refresh_system(&mut self)

Refresh system information (such as memory, swap, CPU usage and components' temperature). Read more

fn refresh_all(&mut self)

Refreshes all system, processes and disks information.

fn get_process_by_name(&self, name: &str) -> Vec<&Process>

Returns a list of process containing the given name.

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,

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where T: ?Sized,

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where T: ?Sized,

fn borrow_mut(&mut self) -> &mutT

Mutably borrows from an owned value. Read more

impl<T> From<T> for T

fn from(t: T) -> T

Performs the conversion.

impl<T, U> Into<U> for T where U: From<T>,

fn into(self) -> U

Performs the conversion.

impl<T, U> TryFrom<U> for T where U: Into<T>,

type Error = Infallible

The type returned in the event of a conversion error.

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.

impl<T, U> TryInto<U> for T where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.