pub enum Operation {
Create {
path: RepositoryPath,
entry: FileEntry,
},
Replace {
path: RepositoryPath,
entry: FileEntry,
},
Delete {
path: RepositoryPath,
},
}Expand description
One filesystem change a Plan will make when applied.
Variants§
Create
Create a file that does not exist yet.
Fields
§
path: RepositoryPathThe repository-relative path to create.
Replace
Replace an existing file’s content and mode.
Fields
§
path: RepositoryPathThe repository-relative path to replace.
Delete
Delete a file that is no longer desired.
Fields
§
path: RepositoryPathThe repository-relative path to delete.
Implementations§
Source§impl Operation
impl Operation
Sourcepub const fn path(&self) -> &RepositoryPath
pub const fn path(&self) -> &RepositoryPath
The repository-relative path this operation changes.
fn apply(&self, root: &Path) -> Result<(), FilesError>
Source§impl Operation
impl Operation
Sourcepub fn unified_diff(&self, plan: &Plan) -> Result<Option<String>, FilesError>
pub fn unified_diff(&self, plan: &Plan) -> Result<Option<String>, FilesError>
The unified diff of this operation against the content plan was
built against.
Returns None when either side is not UTF-8 or nothing differs.
§Errors
Returns an error when the current content cannot be read.
Trait Implementations§
impl Eq for Operation
impl StructuralPartialEq for Operation
Auto Trait Implementations§
impl Freeze for Operation
impl RefUnwindSafe for Operation
impl Send for Operation
impl Sync for Operation
impl Unpin for Operation
impl UnsafeUnpin for Operation
impl UnwindSafe for Operation
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.