sys
31 items · generated by scribe fromstdlib/sys.fd· synced 2026-11-15
Contents
- _SC_PAGESIZE: (const)
- sys_arch (function)
- sys_cpu_count (function)
- sys_cpu_count_conf (function)
- sys_page_size (function)
- sys_total_memory (function)
- sys_available_memory (function)
- sys_total_memory_kb (function)
- sys_total_memory_mb (function)
- sys_total_memory_gb (function)
- sys_pid (function)
- sys_ppid (function)
- sys_uid (function)
- sys_gid (function)
- sys_clk_tck (function)
- sys_is_linux (function)
- sys_is_macos (function)
- sys_is_windows (function)
- sys_is_64bit (function)
- sys_is_32bit (function)
- sys_is_little_endian (function)
- sys_is_big_endian (function)
- SystemInfo (struct)
- sys_info (function)
- sys_info_string (function)
_SC_PAGESIZE:
pub const _SC_PAGESIZE: i64 = 30; pub const _SC_CLK_TCK: i64 = 2; pub const _SC_NPROCESSORS_ONLN: i64 = 84; pub const _SC_NPROCESSORS_CONF: i64 = 83; pub const _SC_PHYS_PAGES: i64 = 85; pub const _SC_AVPHYS_PAGES: i64 = 86;Defined at line 26
sys_arch
Get the CPU architecture (best-effort).
pub fn sys_arch() -> str {Returns: str
Defined at line 30
sys_cpu_count
Get the number of processors currently online.
pub fn sys_cpu_count() -> i64 {Returns: i64
Defined at line 40
sys_cpu_count_conf
Get the number of configured processors.
pub fn sys_cpu_count_conf() -> i64 {Returns: i64
Defined at line 49
sys_page_size
Get the system page size in bytes.
pub fn sys_page_size() -> i64 {Returns: i64
Defined at line 60
sys_total_memory
Get total physical memory in bytes.
pub fn sys_total_memory() -> i64 {Returns: i64
Defined at line 69
sys_available_memory
Get available (free) physical memory in bytes.
pub fn sys_available_memory() -> i64 {Returns: i64
Defined at line 76
sys_total_memory_kb
Get total memory in KB (rounded).
pub fn sys_total_memory_kb() -> i64 {Returns: i64
Defined at line 83
sys_total_memory_mb
Get total memory in MB (rounded).
pub fn sys_total_memory_mb() -> i64 {Returns: i64
Defined at line 88
sys_total_memory_gb
Get total memory in GB (rounded).
pub fn sys_total_memory_gb() -> i64 {Returns: i64
Defined at line 93
sys_pid
Get the current process ID.
pub fn sys_pid() -> i64 {Returns: i64
Defined at line 100
sys_ppid
Get the parent process ID.
pub fn sys_ppid() -> i64 {Returns: i64
Defined at line 105
sys_uid
Get the user ID.
pub fn sys_uid() -> i64 {Returns: i64
Defined at line 110
sys_gid
Get the group ID.
pub fn sys_gid() -> i64 {Returns: i64
Defined at line 115
sys_clk_tck
Get the clock ticks per second.
pub fn sys_clk_tck() -> i64 {Returns: i64
Defined at line 122
sys_is_linux
Check if running on Linux.
pub fn sys_is_linux() -> bool {Returns: bool
Defined at line 133
sys_is_macos
Check if running on macOS.
pub fn sys_is_macos() -> bool {Returns: bool
Defined at line 138
sys_is_windows
Check if running on Windows.
pub fn sys_is_windows() -> bool {Returns: bool
Defined at line 144
sys_is_64bit
Check if running on a 64-bit system.
pub fn sys_is_64bit() -> bool {Returns: bool
Defined at line 150
sys_is_32bit
Check if running on a 32-bit system.
pub fn sys_is_32bit() -> bool {Returns: bool
Defined at line 155
sys_is_little_endian
Check if the system is little-endian.
pub fn sys_is_little_endian() -> bool {Returns: bool
Defined at line 162
sys_is_big_endian
Check if the system is big-endian.
pub fn sys_is_big_endian() -> bool {Returns: bool
Defined at line 179
SystemInfo
A struct containing system information.
pub struct SystemInfo {Fields:
| Name | Type |
|---|---|
arch | str |
os_name | str |
cpu_count | i64 |
memory_bytes | i64 |
page_size | i64 |
pid | i64 |
uid | i64 |
Defined at line 186
sys_info
Gather system information into a struct.
pub fn sys_info() -> SystemInfo {Returns: SystemInfo
Defined at line 197
sys_info_string
Format system info as a human-readable string.
pub fn sys_info_string(info: SystemInfo) -> str {Parameters:
info:SystemInfo
Returns: str
Defined at line 204
Generated by scribe, the Fides documentation generator