pub struct VmResource {
pub cpu_num: u16,
pub mem_size: u32,
pub disk_size: u32,
pub ip_addr: IpAddr,
pub mac_addr: MacAddr,
pub port_map: HashMap<InnerSockPort, PubSockPort>,
}Expand description
Info about the resource of VM.
Fields§
§cpu_num: u16CPU number
mem_size: u32Memory size in MB
disk_size: u32Disk size in MB
ip_addr: IpAddrInner IP address, e.g. ‘[10,0,0,2]’, IP is generated from ‘MAC address’, use the last three fields of MAC.
mac_addr: MacAddrMAC address, e.g. ‘[0x82,0x17,0x0d,0x6a,0xbc,0x80]’, used to generate the responding IP address.
port_map: HashMap<InnerSockPort, PubSockPort>Ports allocation for NAT, that is: {Private Port within VM} => {Public Port within Host}.
If the type of network is Flatten, this field should be empty(and be ignored).
Trait Implementations§
Source§impl Debug for VmResource
impl Debug for VmResource
Source§impl Default for VmResource
impl Default for VmResource
Source§fn default() -> VmResource
fn default() -> VmResource
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for VmResource
impl RefUnwindSafe for VmResource
impl Send for VmResource
impl Sync for VmResource
impl Unpin for VmResource
impl UnwindSafe for VmResource
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more