pub struct Machine<'m> { /* private fields */ }Expand description
A VMM machine.
Implementations§
Source§impl<'m> Machine<'m>
impl<'m> Machine<'m>
Sourcepub async fn create(config: Config<'m>) -> Result<Machine<'m>, Error>
pub async fn create(config: Config<'m>) -> Result<Machine<'m>, Error>
Create a new machine.
The machine is not started yet.
Sourcepub async fn connect(config: Config<'m>, state: MachineState) -> Machine<'m>
pub async fn connect(config: Config<'m>, state: MachineState) -> Machine<'m>
Connect to already created machine.
The machine should be created first via call to create
Sourcepub async fn force_shutdown(&mut self) -> Result<(), Error>
pub async fn force_shutdown(&mut self) -> Result<(), Error>
Forcefully shutdown the machine.
This will be done by killing VM process.
Sourcepub async fn shutdown(&self) -> Result<(), Error>
pub async fn shutdown(&self) -> Result<(), Error>
Shutdown requests a clean shutdown of the VM by sending CtrlAltDelete on the virtual keyboard.
Sourcepub async fn delete(self) -> Result<(), Error>
pub async fn delete(self) -> Result<(), Error>
Delete the machine.
Deletes the machine, cleaning up all associated resources.
If machine is running, it is shut down before resources are deleted.
Sourcepub fn state(&self) -> MachineState
pub fn state(&self) -> MachineState
Get the machine state
Returns SHUTOFF is machine is not running
Trait Implementations§
Auto Trait Implementations§
impl<'m> Freeze for Machine<'m>
impl<'m> !RefUnwindSafe for Machine<'m>
impl<'m> Send for Machine<'m>
impl<'m> Sync for Machine<'m>
impl<'m> Unpin for Machine<'m>
impl<'m> !UnwindSafe for Machine<'m>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more