firecracker_sdk/vm/firercracker_process/
mod.rs

1use anyhow::Result;
2use tokio::process::Child;
3
4pub mod firecracker_startup;
5
6/// Structure for managing the Firecracker process created using `FirecrackerStartup`
7pub struct FirecrackerProcess {
8    process: Child,
9}
10
11impl FirecrackerProcess {
12    pub(crate) fn new(child: Child) -> Self {
13        Self { process: child }
14    }
15
16    /// Correctly starts the process stop and waits for it to complete
17    pub async fn stop(&mut self) -> Result<()> {
18        self.process.kill().await?;
19        Ok(())
20    }
21}