firecracker_rs_sdk/models/
snapshot_create_params.rs

1use std::path::PathBuf;
2
3use serde::{Deserialize, Serialize};
4
5#[derive(Serialize, Deserialize, Debug, Clone)]
6pub struct SnapshotCreateParams {
7    /// Path to the file that will contain the guest memory.
8    /// Required: true
9    #[serde(rename = "mem_file_path")]
10    pub mem_file_path: PathBuf,
11
12    /// Path to the file that will contain the microVM state.
13    /// Required: true
14    #[serde(rename = "snapshot_path")]
15    pub snapshot_path: PathBuf,
16
17    /// Type of snapshot to create. It is optional and by default, a full snapshot is created.
18    /// Enum: [Full Diff]
19    #[serde(rename = "snapshot_type", skip_serializing_if = "Option::is_none")]
20    pub snapshot_type: Option<SnapshotType>,
21
22    /// The microVM version for which we want to create the snapshot.
23    /// It is optional and it defaults to the current version.
24    #[serde(rename = "version", skip_serializing_if = "Option::is_none")]
25    pub version: Option<String>,
26}
27
28#[derive(Debug, Clone, Copy, Deserialize, Serialize, Default)]
29pub enum SnapshotType {
30    #[default]
31    #[serde(rename = "Full")]
32    Full,
33    #[serde(rename = "Diff")]
34    Diff,
35}