pub struct PatchFile {
pub path: String,
pub hunks: Vec<Hunk>,
pub is_creation: bool,
pub is_deletion: bool,
pub rename_from: Option<String>,
pub copy_from: Option<String>,
pub unsupported: Option<String>,
}Fields§
§path: String§hunks: Vec<Hunk>§is_creation: booltrue when the --- line is /dev/null (new file creation).
is_deletion: booltrue when the +++ line is /dev/null (file deletion).
rename_from: Option<String>When --- a/old and +++ b/new differ (git rename), the pre-rename path.
Content is loaded from this path; result is written to [path] (#2101).
copy_from: Option<String>Git 100% copy source (copy from). Dest is [path]. Source is kept
(rename_from stays None). (#2171)
unsupported: Option<String>Dest is listed for preflight but apply refuses (GIT binary patch,
Binary files … differ, mode-only chmod). (#2173)
Implementations§
Source§impl PatchFile
impl PatchFile
Sourcepub fn uses_entry_containment(&self) -> bool
pub fn uses_entry_containment(&self) -> bool
True when dest/source should use entry PathGuard (no-follow last component): git rename and empty-hunk delete. Hunked delete applies minus lines and leftover rewrites, so follow-mode dest-deny applies.
Sourcepub fn declared_paths(&self) -> Vec<String>
pub fn declared_paths(&self) -> Vec<String>
Dest and source paths this file entry would touch (C-unescaped).
Trait Implementations§
impl Eq for PatchFile
impl StructuralPartialEq for PatchFile
Auto Trait Implementations§
impl Freeze for PatchFile
impl RefUnwindSafe for PatchFile
impl Send for PatchFile
impl Sync for PatchFile
impl Unpin for PatchFile
impl UnsafeUnpin for PatchFile
impl UnwindSafe for PatchFile
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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