pub enum Platform {
MacOS,
LinuxNative,
LinuxNoKvm,
Wsl2,
Windows,
}Expand description
The execution environment for running workloads.
Variants§
MacOS
macOS — Apple Virtualization.framework on 26+, Lima fallback on older
LinuxNative
Native Linux with /dev/kvm available — run Firecracker directly
LinuxNoKvm
Linux without /dev/kvm (not WSL) — requires Lima or Docker
Wsl2
WSL2 — may have KVM (Hyper-V nested virt), prefers Docker as fallback
Windows
Native Windows — Docker only (no Linux kernel)
Implementations§
Source§impl Platform
impl Platform
Sourcepub fn needs_lima(self) -> bool
pub fn needs_lima(self) -> bool
Whether this platform needs Lima to run Firecracker. Returns false for platforms that have better alternatives (Apple VZ, Docker, native KVM).
Sourcepub fn supports_native_runner(self) -> bool
pub fn supports_native_runner(self) -> bool
Whether the microvm.nix runner can execute natively (without Lima).
Sourcepub fn has_apple_containers(self) -> bool
pub fn has_apple_containers(self) -> bool
Whether Apple Containers are available on this platform.
Requires macOS 26+ on Apple Silicon.
Sourcepub fn has_docker(self) -> bool
pub fn has_docker(self) -> bool
Whether Docker is available on this platform.
Runtime check — calls docker version to verify the daemon is running.
Sourcepub fn has_host_nix(self) -> bool
pub fn has_host_nix(self) -> bool
Whether Nix is available on the host and can build Linux targets.
On macOS this requires nix-daemon with a linux-builder configured.
On native Linux this is always true if nix is on PATH.
When true, nix build can run on the host without Lima.
Sourcepub fn is_windows(self) -> bool
pub fn is_windows(self) -> bool
Whether this platform is native Windows.
Trait Implementations§
impl Copy for Platform
impl Eq for Platform
impl StructuralPartialEq for Platform
Auto Trait Implementations§
impl Freeze for Platform
impl RefUnwindSafe for Platform
impl Send for Platform
impl Sync for Platform
impl Unpin for Platform
impl UnsafeUnpin for Platform
impl UnwindSafe for Platform
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.