[][src]Struct ttcore::Resource

pub struct Resource {
    pub vm_active: u32,
    pub cpu_total: u64,
    pub cpu_used: u32,
    pub mem_total: u64,
    pub mem_used: u32,
    pub disk_total: u64,
    pub disk_used: u32,
}

已分配的资源信息, *_used 字段使用 u32 类型, 防止统计数据时的加和运算溢出

Fields

vm_active: u32

Vm 数量

cpu_total: u64

Cpu 核心数

cpu_used: u32

已使用的 Cpu

mem_total: u64

内存容量(MB)

mem_used: u32

已使用的内存(MB)

disk_total: u64

磁盘容量(MB)

disk_used: u32

已使用的磁盘(MB)

Implementations

impl Resource[src]

pub fn new(cpu_total: u64, mem_total: u64, disk_total: u64) -> Resource[src]

设置资源限制时使用

Trait Implementations

impl Clone for Resource[src]

impl Copy for Resource[src]

impl Debug for Resource[src]

impl Default for Resource[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.