pub struct FileChange {
pub path: String,
pub kind: DiffKind,
}Expand description
A single file change with path and kind.
Fields§
§path: StringPath to the file (relative to repository root).
kind: DiffKindKind of change.
Implementations§
Source§impl FileChange
impl FileChange
Sourcepub fn added(path: impl Into<String>) -> FileChange
pub fn added(path: impl Into<String>) -> FileChange
Create an added file change.
Sourcepub fn modified(path: impl Into<String>) -> FileChange
pub fn modified(path: impl Into<String>) -> FileChange
Create a modified file change.
Sourcepub fn deleted(path: impl Into<String>) -> FileChange
pub fn deleted(path: impl Into<String>) -> FileChange
Create a deleted file change.
Sourcepub fn into_tuple(self) -> (String, DiffKind)
pub fn into_tuple(self) -> (String, DiffKind)
Convert to tuple representation.
Sourcepub fn from_tuple(_: (String, DiffKind)) -> FileChange
pub fn from_tuple(_: (String, DiffKind)) -> FileChange
Convert from tuple representation.
Trait Implementations§
Source§impl Clone for FileChange
impl Clone for FileChange
Source§fn clone(&self) -> FileChange
fn clone(&self) -> FileChange
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 FileChange
impl Debug for FileChange
impl Eq for FileChange
Source§impl Extend<FileChange> for FileChangeSet
impl Extend<FileChange> for FileChangeSet
Source§fn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = FileChange>,
fn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = FileChange>,
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl PartialEq for FileChange
impl PartialEq for FileChange
impl StructuralPartialEq for FileChange
Auto Trait Implementations§
impl Freeze for FileChange
impl RefUnwindSafe for FileChange
impl Send for FileChange
impl Sync for FileChange
impl Unpin for FileChange
impl UnsafeUnpin for FileChange
impl UnwindSafe for FileChange
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