#[repr(C)]pub struct SysInfo {Show 13 fields
pub uptime: c_ulong,
pub loads: [c_ulong; 3],
pub totalram: c_ulong,
pub freeram: c_ulong,
pub sharedram: c_ulong,
pub bufferram: c_ulong,
pub totalswap: c_ulong,
pub freeswap: c_ulong,
pub procs: u16,
pub totalhigh: c_ulong,
pub freehigh: c_ulong,
pub mem_unit: c_uint,
pub _reserved: [u8; 256],
}Expand description
系统信息结构体
对应 Linux 的 struct sysinfo
Fields§
§uptime: c_ulong系统启动后经过的时间,单位为秒
loads: [c_ulong; 3]1 分钟、5 分钟和 15 分钟的平均负载
totalram: c_ulong总内存大小,单位为字节
freeram: c_ulong可用内存大小,单位为字节
缓存大小,单位为字节
bufferram: c_ulong用作文件缓存的内存大小,单位为字节
totalswap: c_ulong总交换空间大小,单位为字节
freeswap: c_ulong可用交换空间大小,单位为字节
procs: u16当前进程数
totalhigh: c_ulong高端内存总大小,单位为字节
freehigh: c_ulong高端可用内存大小,单位为字节
mem_unit: c_uint内存单位大小,单位为字节
_reserved: [u8; 256]保留字段,供未来使用
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SysInfo
impl RefUnwindSafe for SysInfo
impl Send for SysInfo
impl Sync for SysInfo
impl Unpin for SysInfo
impl UnwindSafe for SysInfo
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)