[][src]Struct ttcore::Env

pub struct Env { /* fields omitted */ }

描述一个环境实例

Implementations

impl Env[src]

pub fn new(serv: &Arc<Serv>, id: &EnvIdRef) -> Result<Env>[src]

创建新的 Env 实例, 内部自动生成 ID

pub fn update_life(&mut self, secs: u64, is_fucker: bool) -> Result<()>[src]

更新已有实例的生命周期

pub fn update_hardware(
    &mut self,
    cpu_num: Option<u32>,
    mem_size: Option<u32>,
    disk_size: Option<u32>,
    vm_port: &[Port],
    deny_outgoing: Option<bool>
) -> Result<()>
[src]

更新已有实例的硬件配置

除只更新端口的情况以外, 须检查:

  • ENV 必须处于 stop 状态
  • 系统资源足以支掌新的配置

pub fn add_vm_set(&mut self, cfg_set: Vec<VmCfg>) -> Result<()>[src]

批量创建 Vm 实例

Trait Implementations

impl Clone for Env[src]

impl Debug for Env[src]

impl Drop for Env[src]

Auto Trait Implementations

impl !RefUnwindSafe for Env

impl Send for Env

impl Sync for Env

impl Unpin for Env

impl !UnwindSafe for Env

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.