pub struct FileOperation {Show 13 fields
pub operation: FileOperationKind,
pub source: PathBuf,
pub target: PathBuf,
pub source_path: PathBuf,
pub target_path: PathBuf,
pub required: bool,
pub compare: Option<SyncCompare>,
pub delete: Option<bool>,
pub symlinks: Option<SymlinkMode>,
pub include: Vec<String>,
pub ignore: Vec<String>,
pub ignore_metadata: Vec<MetadataField>,
pub declaration: SourceSpan,
}Expand description
A normalized file operation.
Fields§
§operation: FileOperationKindFile operation kind.
source: PathBufDeclared source path.
target: PathBufDeclared target path.
source_path: PathBufSource path resolved from the root checkout.
target_path: PathBufTarget path resolved from the current worktree.
required: boolWhether a missing source should fail validation.
compare: Option<SyncCompare>Sync comparison mode.
delete: Option<bool>Whether sync should delete target-only files.
symlinks: Option<SymlinkMode>How copy and sync should treat source symlinks.
include: Vec<String>Source-relative path patterns that narrow copy and sync directory traversal to matching source paths. Empty means no include filtering.
ignore: Vec<String>Source-relative path patterns ignored by copy and sync.
ignore_metadata: Vec<MetadataField>Metadata fields ignored by copy and sync.
declaration: SourceSpanSource location for the operation declaration.
Implementations§
Source§impl FileOperation
impl FileOperation
Sourcepub fn from_manual_options(
context: &Worktree,
options: ManualFileOperationOptions,
) -> Result<Vec<Self>>
pub fn from_manual_options( context: &Worktree, options: ManualFileOperationOptions, ) -> Result<Vec<Self>>
Builds normalized manual file operation specs for an action plan.
This applies the same target derivation and option validation used by
treeboot copy, treeboot symlink, and treeboot sync.
§Errors
Returns an error when the manual operation has no sources, when an option is not valid for the selected operation kind, or when a target cannot be derived for an absolute source.
Trait Implementations§
Source§impl Clone for FileOperation
impl Clone for FileOperation
Source§fn clone(&self) -> FileOperation
fn clone(&self) -> FileOperation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FileOperation
impl Debug for FileOperation
impl Eq for FileOperation
Source§impl PartialEq for FileOperation
impl PartialEq for FileOperation
Source§fn eq(&self, other: &FileOperation) -> bool
fn eq(&self, other: &FileOperation) -> bool
self and other values to be equal, and is used by ==.