pub struct FileHeader {
pub kind: FileKind,
pub old_path: Option<PathBuf>,
pub new_path: Option<PathBuf>,
pub old_mode: Option<FileMode>,
pub new_mode: Option<FileMode>,
pub old_oid: Option<Oid>,
pub new_oid: Option<Oid>,
pub raw: Vec<String>,
}Expand description
Metadata lines that introduce a file section in a Git patch.
Fields§
§kind: FileKindClassified kind of file change.
old_path: Option<PathBuf>Path on the old side of the diff, when present.
new_path: Option<PathBuf>Path on the new side of the diff, when present.
old_mode: Option<FileMode>File mode on the old side of the diff, when present.
new_mode: Option<FileMode>File mode on the new side of the diff, when present.
old_oid: Option<Oid>Object id on the old side of the diff, when present.
new_oid: Option<Oid>Object id on the new side of the diff, when present.
raw: Vec<String>Raw header lines preserved for callers that need exact metadata.
Implementations§
Source§impl FileHeader
impl FileHeader
Sourcepub fn display_path(&self) -> Option<&PathBuf>
pub fn display_path(&self) -> Option<&PathBuf>
Returns the path callers should usually show for this file.
Trait Implementations§
Source§impl Clone for FileHeader
impl Clone for FileHeader
Source§fn clone(&self) -> FileHeader
fn clone(&self) -> FileHeader
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FileHeader
impl Debug for FileHeader
impl Eq for FileHeader
Source§impl PartialEq for FileHeader
impl PartialEq for FileHeader
impl StructuralPartialEq for FileHeader
Auto Trait Implementations§
impl Freeze for FileHeader
impl RefUnwindSafe for FileHeader
impl Send for FileHeader
impl Sync for FileHeader
impl Unpin for FileHeader
impl UnsafeUnpin for FileHeader
impl UnwindSafe for FileHeader
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