Skip to main content

Vm

Trait Vm 

Source
pub trait Vm: Send {
    // Required methods
    fn inject<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        host_path: &'life1 Path,
        guest_path: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn exec<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
        &'life0 self,
        cmd: &'life1 str,
        env: &'life2 [(String, String)],
        working_dir: &'life3 str,
        sink: &'life4 dyn OutputSink,
    ) -> Pin<Box<dyn Future<Output = Result<i32>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             'life4: 'async_trait;
    fn snapshot<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        label: &'life1 SnapshotLabel,
    ) -> Pin<Box<dyn Future<Output = Result<SnapshotId>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn destroy<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Handle to a running virtual machine.

Required Methods§

Source

fn inject<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, host_path: &'life1 Path, guest_path: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Copy a host path into the guest filesystem.

Source

fn exec<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, cmd: &'life1 str, env: &'life2 [(String, String)], working_dir: &'life3 str, sink: &'life4 dyn OutputSink, ) -> Pin<Box<dyn Future<Output = Result<i32>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

Run a command inside the VM and stream output to sink.

Source

fn snapshot<'life0, 'life1, 'async_trait>( &'life0 mut self, label: &'life1 SnapshotLabel, ) -> Pin<Box<dyn Future<Output = Result<SnapshotId>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Capture the current VM state as a named snapshot.

Source

fn destroy<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Tear down the VM and release all resources.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§