pub struct VirtualMachine { /* private fields */ }Implementations§
Source§impl VirtualMachine
impl VirtualMachine
pub fn new(config: &VirtualMachineConfiguration) -> VirtualMachine
pub fn supported() -> bool
pub fn start(&self) -> Result<(), VzError>
pub fn stop(&self) -> Result<(), VzError>
pub fn state_channel(&self) -> Receiver<VmState>
pub fn can_start(&self) -> bool
pub fn can_stop(&self) -> bool
pub fn can_pause(&self) -> bool
pub fn can_resume(&self) -> bool
pub fn can_request_stop(&self) -> bool
Sourcepub fn connect_to_vsock_port(&self, port: u32) -> Result<TcpStream, VzError>
pub fn connect_to_vsock_port(&self, port: u32) -> Result<TcpStream, VzError>
Connect to a vsock port on the guest through cloud-hypervisor’s
hybrid vsock socket: send CONNECT <port>\n, expect OK <n>\n,
then the stream is a raw pipe to the guest listener.
The connected UnixStream fd is rewrapped as a TcpStream because
the platform-neutral sandbox API is written against TcpStream;
both are plain stream sockets, so read/write/shutdown/try_clone all
behave (set_nodelay fails and is ignored by callers).
pub fn state(&self) -> VmState
Trait Implementations§
Source§impl Drop for VirtualMachine
impl Drop for VirtualMachine
Auto Trait Implementations§
impl !Freeze for VirtualMachine
impl RefUnwindSafe for VirtualMachine
impl Send for VirtualMachine
impl Sync for VirtualMachine
impl Unpin for VirtualMachine
impl UnsafeUnpin for VirtualMachine
impl UnwindSafe for VirtualMachine
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