pub enum Patch {
Text {
path: String,
content: String,
mode: Option<u32>,
replace: bool,
},
File {
path: String,
content: Vec<u8>,
mode: Option<u32>,
replace: bool,
},
CopyFile {
src: PathBuf,
dst: String,
mode: Option<u32>,
replace: bool,
},
CopyDir {
src: PathBuf,
dst: String,
replace: bool,
},
Symlink {
target: String,
link: String,
replace: bool,
},
Mkdir {
path: String,
mode: Option<u32>,
},
Remove {
path: String,
},
Append {
path: String,
content: String,
},
}Expand description
Rootfs patch applied before VM startup.
Variants§
Text
Write text content to a file.
Fields
File
Write raw bytes to a file.
Fields
CopyFile
Copy a file from the host into the rootfs.
Fields
CopyDir
Copy a directory from the host into the rootfs.
Fields
Symlink
Create a symlink.
Fields
Mkdir
Create a directory.
Fields
Remove
Remove a file or directory.
Append
Append content to an existing file.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Patch
impl<'de> Deserialize<'de> for Patch
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Patch
impl RefUnwindSafe for Patch
impl Send for Patch
impl Sync for Patch
impl Unpin for Patch
impl UnsafeUnpin for Patch
impl UnwindSafe for Patch
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