pub struct OperationParams {
pub operation: OperationType,
pub target_type: TargetType,
pub source: PathBuf,
pub destination: Option<PathBuf>,
pub compress: bool,
pub show_progress: bool,
pub buffer_size: usize,
pub preserve_filename: bool,
pub delete_source: bool,
pub verify_checksum: bool,
pub public_key_path: Option<PathBuf>,
pub private_key_path: Option<PathBuf>,
}
Expand description
Operation parameters
Fields§
§operation: OperationType
Type of operation (encrypt/decrypt)
target_type: TargetType
Target type (file/directory)
source: PathBuf
Source path
destination: Option<PathBuf>
Destination path (optional, defaults based on operation)
compress: bool
Whether to enable compression
show_progress: bool
Whether to show progress
buffer_size: usize
Buffer size for file operations
preserve_filename: bool
Whether to preserve original filename (new feature)
delete_source: bool
Whether to delete source file after operation
verify_checksum: bool
Whether to verify checksum after decryption
public_key_path: Option<PathBuf>
Public key path for hybrid encryption (optional, will auto-discover if None)
private_key_path: Option<PathBuf>
Private key path for hybrid decryption (optional, will auto-discover if None)
Implementations§
Source§impl OperationParams
impl OperationParams
Sourcepub fn new(
operation: OperationType,
target_type: TargetType,
source: PathBuf,
) -> Self
pub fn new( operation: OperationType, target_type: TargetType, source: PathBuf, ) -> Self
Create new operation parameters
Sourcepub fn with_destination(self, destination: PathBuf) -> Self
pub fn with_destination(self, destination: PathBuf) -> Self
Set destination path
Sourcepub fn with_compression(self, compress: bool) -> Self
pub fn with_compression(self, compress: bool) -> Self
Enable compression
Sourcepub fn with_progress(self, show_progress: bool) -> Self
pub fn with_progress(self, show_progress: bool) -> Self
Set progress visibility
Sourcepub fn with_buffer_size(self, buffer_size: usize) -> Self
pub fn with_buffer_size(self, buffer_size: usize) -> Self
Set buffer size
Sourcepub fn with_preserve_filename(self, preserve_filename: bool) -> Self
pub fn with_preserve_filename(self, preserve_filename: bool) -> Self
Set filename preservation
Sourcepub fn with_delete_source(self, delete_source: bool) -> Self
pub fn with_delete_source(self, delete_source: bool) -> Self
Set source deletion after operation
Sourcepub fn with_verify_checksum(self, verify_checksum: bool) -> Self
pub fn with_verify_checksum(self, verify_checksum: bool) -> Self
Set checksum verification
Sourcepub fn with_public_key_path(self, public_key_path: PathBuf) -> Self
pub fn with_public_key_path(self, public_key_path: PathBuf) -> Self
Set public key path for hybrid encryption
Sourcepub fn with_private_key_path(self, private_key_path: PathBuf) -> Self
pub fn with_private_key_path(self, private_key_path: PathBuf) -> Self
Set private key path for hybrid decryption
Sourcepub fn get_destination(&self) -> PathBuf
pub fn get_destination(&self) -> PathBuf
Get the default destination path based on source and operation
Trait Implementations§
Source§impl Clone for OperationParams
impl Clone for OperationParams
Source§fn clone(&self) -> OperationParams
fn clone(&self) -> OperationParams
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for OperationParams
impl RefUnwindSafe for OperationParams
impl Send for OperationParams
impl Sync for OperationParams
impl Unpin for OperationParams
impl UnwindSafe for OperationParams
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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