pub struct FirecrackerStartup { /* private fields */ }Expand description
A structure for configuring the launch of FirecrackerVM. Helps to preconfigure and start the virtual machine.
Note: Firecracker must be installed globally.
Exemple:
let process = FirecrackerStartup::new()
.set_api_socket("/tmp/some.socket")
.download_rootfs(true)
.download_kernel(true)
.start().await.unwrap();Implementations§
Source§impl FirecrackerStartup
impl FirecrackerStartup
Sourcepub fn set_api_socket<P: AsRef<Path>>(self, path: P) -> Self
pub fn set_api_socket<P: AsRef<Path>>(self, path: P) -> Self
Set the –api-sock startup argument with the path to the unix socket
Note: For the best documentation, please refer to here.
Sourcepub fn get_api_socket(&self) -> &PathBuf
pub fn get_api_socket(&self) -> &PathBuf
Returns the –api-sock startup argument with the path to the unix socket
Note: For the best documentation, please refer to here.
Sourcepub fn download_kernel(self, flag: bool) -> Self
pub fn download_kernel(self, flag: bool) -> Self
Flag to download the latest kernel version for microVM
Sourcepub fn download_rootfs(self, flag: bool) -> Self
pub fn download_rootfs(self, flag: bool) -> Self
Flag to download the ubuntu-22.04.ext4 for microVM
Sourcepub async fn start(self) -> Result<FirecrackerProcess>
pub async fn start(self) -> Result<FirecrackerProcess>
Starts a VM with specified parameters Returns a structure for working with the Firecracker process
Trait Implementations§
Source§impl Default for FirecrackerStartup
impl Default for FirecrackerStartup
Auto Trait Implementations§
impl Freeze for FirecrackerStartup
impl RefUnwindSafe for FirecrackerStartup
impl Send for FirecrackerStartup
impl Sync for FirecrackerStartup
impl Unpin for FirecrackerStartup
impl UnwindSafe for FirecrackerStartup
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