pub struct WatchConfig {
pub watch_dir: PathBuf,
pub target_dir: Option<PathBuf>,
pub operation: OperationType,
pub password: String,
pub delete_source: bool,
pub compress: bool,
pub watch_extensions: Option<Vec<String>>,
pub process_existing: bool,
pub debounce_ms: u64,
}Expand description
Watch mode configuration
Fields§
§watch_dir: PathBufDirectory to watch
target_dir: Option<PathBuf>Target directory for processed files (None = same as source)
operation: OperationTypeOperation type (encrypt or decrypt)
password: StringPassword for operations
delete_source: boolWhether to delete source files after processing
compress: boolWhether to enable compression
watch_extensions: Option<Vec<String>>File extensions to watch (None = all files)
process_existing: boolWhether to process existing files on startup
debounce_ms: u64Debounce delay in milliseconds
Implementations§
Source§impl WatchConfig
impl WatchConfig
Sourcepub fn new(
watch_dir: PathBuf,
operation: OperationType,
password: String,
) -> Self
pub fn new( watch_dir: PathBuf, operation: OperationType, password: String, ) -> Self
Create new watch configuration
Sourcepub fn with_target_dir(self, target_dir: PathBuf) -> Self
pub fn with_target_dir(self, target_dir: PathBuf) -> Self
Set target directory
Sourcepub fn with_delete_source(self, delete_source: bool) -> Self
pub fn with_delete_source(self, delete_source: bool) -> Self
Enable source file deletion
Sourcepub fn with_compression(self, compress: bool) -> Self
pub fn with_compression(self, compress: bool) -> Self
Enable compression
Sourcepub fn with_extensions(self, extensions: Vec<String>) -> Self
pub fn with_extensions(self, extensions: Vec<String>) -> Self
Set file extensions to watch
Sourcepub fn with_process_existing(self, process_existing: bool) -> Self
pub fn with_process_existing(self, process_existing: bool) -> Self
Enable processing existing files
Sourcepub fn with_debounce_ms(self, debounce_ms: u64) -> Self
pub fn with_debounce_ms(self, debounce_ms: u64) -> Self
Set debounce delay
Sourcepub fn should_process_file(&self, path: &Path) -> bool
pub fn should_process_file(&self, path: &Path) -> bool
Check if file should be processed based on extension filter
Sourcepub fn should_process_by_operation(&self, path: &Path) -> bool
pub fn should_process_by_operation(&self, path: &Path) -> bool
Check if file should be processed based on operation type
Trait Implementations§
Source§impl Clone for WatchConfig
impl Clone for WatchConfig
Source§fn clone(&self) -> WatchConfig
fn clone(&self) -> WatchConfig
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 moreAuto Trait Implementations§
impl Freeze for WatchConfig
impl RefUnwindSafe for WatchConfig
impl Send for WatchConfig
impl Sync for WatchConfig
impl Unpin for WatchConfig
impl UnwindSafe for WatchConfig
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> 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