Vm

Struct Vm 

Source
pub struct Vm {
    pub id: Id,
    pub name: Option<String>,
    pub engine: Arc<dyn VmEngine>,
    pub template: Arc<VmTemplate>,
    pub runtime_image: String,
    pub net_kind: NetKind,
    pub snapshots: HashMap<String, Snapshot>,
    pub latest_meta: Option<PathBuf>,
    pub state: VmState,
    pub resource: VmResource,
    pub addr: NetAddr,
    pub features: HashSet<VmFeature>,
}
Expand description

Infomations about a VM instance.

Fields§

§id: Id

UUID of this VM

§name: Option<String>

Name of the VM.

§engine: Arc<dyn VmEngine>

Created by which engine.

§template: Arc<VmTemplate>

Template of runtime_image, that is, the runtime image is created based on the template.

§runtime_image: String

Runtime image of Vm.

Use ‘String’ instead of ‘PathBuf’, because runtime_image may not be a regular file path, such as ZFS stroage.

E.g. zroot/kk/VmId

§net_kind: NetKind

Network kind of this VM.

§snapshots: HashMap<String, Snapshot>

SnapshotName => Snapshot

§latest_meta: Option<PathBuf>

The latest cached config-file.

§state: VmState

Info about the state of VM.

§resource: VmResource

Info about the resource of VM.

§addr: NetAddr

Usually an ‘IP’ or a ‘domain url’.

Only meaningful from the perspective of the client, to indicate how to connect to it from the client.

This has different meanings with the ip_addr in VmResource.

§features: HashSet<VmFeature>

Features required by this vm.

Trait Implementations§

Source§

impl Debug for Vm

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Vm

§

impl !RefUnwindSafe for Vm

§

impl Send for Vm

§

impl Sync for Vm

§

impl Unpin for Vm

§

impl !UnwindSafe for Vm

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.