Struct git_checks_core::impl_prelude::Commit
source · [−]pub struct Commit {
pub sha1: CommitId,
pub message: String,
pub parents: Vec<CommitId>,
pub diffs: Vec<DiffInfo>,
pub author: Identity,
pub committer: Identity,
/* private fields */
}
Expand description
Representation of a commit with information useful for commit checks.
Fields
sha1: CommitId
The SHA1 of the commit.
message: String
The commit message.
parents: Vec<CommitId>
The parents of the commit.
diffs: Vec<DiffInfo>
Information about files that changed in this commit.
The identity of the author.
committer: Identity
The identity of the commiter.
Implementations
sourceimpl Commit
impl Commit
sourcepub fn new(ctx: &GitContext, sha1: &CommitId) -> Result<Self, CommitError>
pub fn new(ctx: &GitContext, sha1: &CommitId) -> Result<Self, CommitError>
Create a new commit from the given context for the SHA1.
sourcepub fn file_patch<P>(&self, path: P) -> Result<String, CommitError> where
P: AsRef<OsStr>,
pub fn file_patch<P>(&self, path: P) -> Result<String, CommitError> where
P: AsRef<OsStr>,
Get the patch difference for the given path.
Trait Implementations
sourceimpl Content for Commit
impl Content for Commit
sourcefn workarea(&self, ctx: &GitContext) -> Result<GitWorkArea, WorkAreaError>
fn workarea(&self, ctx: &GitContext) -> Result<GitWorkArea, WorkAreaError>
A workarea which may be used to work on the content.
sourcefn diffs(&self) -> &Vec<DiffInfo>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
fn diffs(&self) -> &Vec<DiffInfo>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
The differences in the content.
Auto Trait Implementations
impl RefUnwindSafe for Commit
impl Send for Commit
impl Sync for Commit
impl Unpin for Commit
impl UnwindSafe for Commit
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more