pub struct Commit<'repo> { /* private fields */ }Expand description
A singular git commit for the repository being inspected
Implementations§
Source§impl<'repo> Commit<'repo>
impl<'repo> Commit<'repo>
Sourcepub fn new(commit: Commit<'repo>, repository: &'repo Repository) -> Self
pub fn new(commit: Commit<'repo>, repository: &'repo Repository) -> Self
Instantiate a new Commit object from a git2 commit
Return the commit author
Sourcepub fn mod_files(&self) -> Result<impl Iterator<Item = ModifiedFile<'_>>, Error>
pub fn mod_files(&self) -> Result<impl Iterator<Item = ModifiedFile<'_>>, Error>
Return an iterator over the modified files that belong to a commit
Sourcepub fn insertions(&self) -> Result<usize, Error>
pub fn insertions(&self) -> Result<usize, Error>
The number of insertions in the commit
Auto Trait Implementations§
impl<'repo> !Freeze for Commit<'repo>
impl<'repo> !RefUnwindSafe for Commit<'repo>
impl<'repo> !Send for Commit<'repo>
impl<'repo> !Sync for Commit<'repo>
impl<'repo> Unpin for Commit<'repo>
impl<'repo> UnsafeUnpin for Commit<'repo>
impl<'repo> UnwindSafe for Commit<'repo>
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