Skip to main content

InMemoryVmProvider

Struct InMemoryVmProvider 

Source
pub struct InMemoryVmProvider { /* private fields */ }
Expand description

In-memory VM provider for development and testing.

Replace with a hypervisor-backed adapter (e.g. Firecracker, Cloud Hypervisor) for production use.

Trait Implementations§

Source§

impl Clone for InMemoryVmProvider

Source§

fn clone(&self) -> InMemoryVmProvider

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for InMemoryVmProvider

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for InMemoryVmProvider

Source§

fn default() -> InMemoryVmProvider

Returns the “default value” for a type. Read more
Source§

impl VmProvider for InMemoryVmProvider

Source§

fn create_vm(&self, vm_id: &str) -> VmRuntimeResult<()>

Provision a new microVM with workspace defaults. Fails if vm_id is already in use.
Source§

fn start_vm(&self, vm_id: &str) -> VmRuntimeResult<()>

Start a created or stopped microVM. Fails if already running or destroyed.
Source§

fn stop_vm(&self, vm_id: &str) -> VmRuntimeResult<()>

Stop a running microVM. Fails if not currently running.
Source§

fn snapshot_vm(&self, vm_id: &str, snapshot_id: &str) -> VmRuntimeResult<()>

Capture the state of a microVM as a named snapshot. Fails if the VM is destroyed or the snapshot name already exists.
Source§

fn destroy_vm(&self, vm_id: &str) -> VmRuntimeResult<()>

Tear down a microVM. Terminal state — cannot be restarted.
Source§

fn create_vm_with_spec( &self, vm_id: &str, _spec: &VmSpec, ) -> VmRuntimeResult<()>

Provision a new microVM with per-VM configuration overrides. Read more
Source§

fn rename_vm(&self, _old_vm_id: &str, _new_vm_id: &str) -> VmRuntimeResult<()>

Rename a VM. Used for warm-pool handoff: a pre-restored VM that swaps its identifier onto a new tenant request without going through a full snapshot/load round-trip. Read more
Source§

impl VmQuery for InMemoryVmProvider

Source§

fn list_vms(&self) -> VmRuntimeResult<Vec<VmView>>

Return all known VMs, sorted by identifier.
Source§

fn get_vm(&self, vm_id: &str) -> VmRuntimeResult<Option<VmView>>

Return a single VM by identifier, or None if it does not exist.
Source§

fn list_snapshots(&self, vm_id: &str) -> VmRuntimeResult<Option<Vec<String>>>

Return the snapshot names for a VM, or None if the VM does not exist.

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<T> VmRuntime for T
where T: VmProvider + VmQuery,