pub struct ApplyPatchAction {
pub patch: String,
pub cwd: PathBuf,
/* private fields */
}
Expand description
ApplyPatchAction is the result of parsing an apply_patch
command. By
construction, all paths should be absolute paths.
Fields§
§patch: String
The raw patch argument that can be used with apply_patch
as an exec
call. i.e., if the original arg was parsed in “lenient” mode with a
heredoc, this should be the value without the heredoc wrapper.
cwd: PathBuf
The working directory that was used to resolve relative paths in the patch.
Implementations§
Source§impl ApplyPatchAction
impl ApplyPatchAction
pub fn is_empty(&self) -> bool
Sourcepub const fn changes(&self) -> &HashMap<PathBuf, ApplyPatchFileChange>
pub const fn changes(&self) -> &HashMap<PathBuf, ApplyPatchFileChange>
Returns the changes that would be made by applying the patch.
Sourcepub fn new_add_for_test(path: &Path, content: String) -> Self
pub fn new_add_for_test(path: &Path, content: String) -> Self
Should be used exclusively for testing. (Not worth the overhead of creating a feature flag for this.)
Trait Implementations§
Source§impl Debug for ApplyPatchAction
impl Debug for ApplyPatchAction
Source§impl PartialEq for ApplyPatchAction
impl PartialEq for ApplyPatchAction
impl StructuralPartialEq for ApplyPatchAction
Auto Trait Implementations§
impl Freeze for ApplyPatchAction
impl RefUnwindSafe for ApplyPatchAction
impl Send for ApplyPatchAction
impl Sync for ApplyPatchAction
impl Unpin for ApplyPatchAction
impl UnwindSafe for ApplyPatchAction
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