pub struct PackConfig {Show 15 fields
pub disk: Option<PathBuf>,
pub memory: Option<PathBuf>,
pub output: PathBuf,
pub compression: String,
pub encrypt: bool,
pub password: Option<String>,
pub train_dict: bool,
pub block_size: u32,
pub cdc_enabled: bool,
pub min_chunk: u32,
pub avg_chunk: u32,
pub max_chunk: u32,
pub parallel: bool,
pub num_workers: usize,
pub show_progress: bool,
}Expand description
Configuration parameters for snapshot packing.
This struct encapsulates all settings for the packing process. It’s designed to be easily constructed from CLI arguments or programmatic APIs.
§Examples
use hexz_core::ops::pack::PackConfig;
use std::path::PathBuf;
// Basic configuration with defaults
let config = PackConfig {
disk: Some(PathBuf::from("disk.img")),
output: PathBuf::from("snapshot.hxz"),
..Default::default()
};
// Advanced configuration with CDC and encryption
let advanced = PackConfig {
disk: Some(PathBuf::from("disk.img")),
output: PathBuf::from("snapshot.hxz"),
compression: "zstd".to_string(),
encrypt: true,
password: Some("secret".to_string()),
cdc_enabled: true,
min_chunk: 16384,
avg_chunk: 65536,
max_chunk: 131072,
..Default::default()
};Fields§
§disk: Option<PathBuf>Path to the disk image (optional).
memory: Option<PathBuf>Path to the memory image (optional).
output: PathBufOutput snapshot file path.
compression: StringCompression algorithm (“lz4” or “zstd”).
encrypt: boolEnable encryption.
password: Option<String>Encryption password (required if encrypt=true).
train_dict: boolTrain a compression dictionary (zstd only).
block_size: u32Block size in bytes.
cdc_enabled: boolEnable content-defined chunking (CDC).
min_chunk: u32Minimum chunk size for CDC.
avg_chunk: u32Average chunk size for CDC.
max_chunk: u32Maximum chunk size for CDC.
parallel: boolEnable parallel compression (use multiple CPU cores).
num_workers: usizeNumber of worker threads (0 = auto-detect).
show_progress: boolShow progress bar (if no callback provided).
Trait Implementations§
Source§impl Clone for PackConfig
impl Clone for PackConfig
Source§fn clone(&self) -> PackConfig
fn clone(&self) -> PackConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PackConfig
impl Debug for PackConfig
Auto Trait Implementations§
impl Freeze for PackConfig
impl RefUnwindSafe for PackConfig
impl Send for PackConfig
impl Sync for PackConfig
impl Unpin for PackConfig
impl UnsafeUnpin for PackConfig
impl UnwindSafe for PackConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more