Struct git_object::Commit
source · [−]pub struct Commit {
pub tree: ObjectId,
pub parents: SmallVec<[ObjectId; 1]>,
pub author: Signature,
pub committer: Signature,
pub encoding: Option<BString>,
pub message: BString,
pub extra_headers: Vec<(BString, BString)>,
}
Expand description
A mutable git commit, representing an annotated state of a working tree along with a reference to its historical commits.
Fields
tree: ObjectId
The hash of recorded working tree state.
parents: SmallVec<[ObjectId; 1]>
Hash of each parent commit. Empty for the first commit in repository.
Who wrote this commit.
committer: Signature
Who committed this commit.
This may be different from the author
in case the author couldn’t write to the repository themselves and
is commonly encountered with contributed commits.
encoding: Option<BString>
The name of the message encoding, otherwise UTF-8 should be assumed.
message: BString
The commit message documenting the change.
extra_headers: Vec<(BString, BString)>
Extra header fields, in order of them being encountered, made accessible with the iterator returned
by extra_headers()
.
Implementations
sourceimpl Commit
impl Commit
sourcepub fn extra_headers(
&self
) -> ExtraHeaders<impl Iterator<Item = (&BStr, &BStr)>>
pub fn extra_headers(
&self
) -> ExtraHeaders<impl Iterator<Item = (&BStr, &BStr)>>
Returns a convenient iterator over all extra headers.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Commit
impl<'de> Deserialize<'de> for Commit
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Ord for Commit
impl Ord for Commit
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialEq<Commit> for Commit
impl PartialEq<Commit> for Commit
sourceimpl PartialOrd<Commit> for Commit
impl PartialOrd<Commit> for Commit
sourcefn partial_cmp(&self, other: &Commit) -> Option<Ordering>
fn partial_cmp(&self, other: &Commit) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl WriteTo for Commit
impl WriteTo for Commit
impl Eq for Commit
impl StructuralEq for Commit
impl StructuralPartialEq for Commit
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 · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more