pub struct OperationExecutor {
pub default_resolution: Option<ConflictResolution>,
pub use_trash: bool,
}Expand description
Executor for file operations with unified interface.
Fields§
§default_resolution: Option<ConflictResolution>Default conflict resolution.
use_trash: boolWhether to use trash for deletions.
Implementations§
Source§impl OperationExecutor
impl OperationExecutor
Sourcepub fn with_trash() -> Self
pub fn with_trash() -> Self
Create an executor that uses trash for deletions.
Sourcepub fn with_resolution(self, resolution: ConflictResolution) -> Self
pub fn with_resolution(self, resolution: ConflictResolution) -> Self
Set the default conflict resolution.
Sourcepub fn copy(
&self,
sources: Vec<PathBuf>,
destination: PathBuf,
) -> Receiver<OperationResult>
pub fn copy( &self, sources: Vec<PathBuf>, destination: PathBuf, ) -> Receiver<OperationResult>
Execute a copy operation (non-cancellable convenience wrapper).
Creates an internal CancellationToken that is never cancelled.
Use copy_with_cancellation when the
caller needs to abort the operation.
Sourcepub fn copy_with_cancellation(
&self,
sources: Vec<PathBuf>,
destination: PathBuf,
token: CancellationToken,
) -> Receiver<OperationResult>
pub fn copy_with_cancellation( &self, sources: Vec<PathBuf>, destination: PathBuf, token: CancellationToken, ) -> Receiver<OperationResult>
Execute a copy operation with cancellation support.
Sourcepub fn move_to(
&self,
sources: Vec<PathBuf>,
destination: PathBuf,
) -> Receiver<OperationResult>
pub fn move_to( &self, sources: Vec<PathBuf>, destination: PathBuf, ) -> Receiver<OperationResult>
Execute a move operation (non-cancellable convenience wrapper).
Creates an internal CancellationToken that is never cancelled.
Use move_to_with_cancellation
when the caller needs to abort the operation.
Sourcepub fn move_to_with_cancellation(
&self,
sources: Vec<PathBuf>,
destination: PathBuf,
token: CancellationToken,
) -> Receiver<OperationResult>
pub fn move_to_with_cancellation( &self, sources: Vec<PathBuf>, destination: PathBuf, token: CancellationToken, ) -> Receiver<OperationResult>
Execute a move operation with cancellation support.
Sourcepub fn rename(
&self,
source: PathBuf,
new_name: String,
) -> Receiver<OperationResult>
pub fn rename( &self, source: PathBuf, new_name: String, ) -> Receiver<OperationResult>
Execute a rename operation.
Sourcepub fn create_file(&self, path: PathBuf) -> Receiver<OperationResult>
pub fn create_file(&self, path: PathBuf) -> Receiver<OperationResult>
Execute a file creation operation.
Sourcepub fn create_directory(&self, path: PathBuf) -> Receiver<OperationResult>
pub fn create_directory(&self, path: PathBuf) -> Receiver<OperationResult>
Execute a directory creation operation.