Struct git_object::CommitRef [−][src]
pub struct CommitRef<'a> {
pub tree: &'a BStr,
pub parents: SmallVec<[&'a BStr; 2]>,
pub author: SignatureRef<'a>,
pub committer: SignatureRef<'a>,
pub encoding: Option<&'a BStr>,
pub message: &'a BStr,
pub extra_headers: Vec<(&'a BStr, Cow<'a, BStr>)>,
}
Expand description
A git commit parsed using from_bytes()
.
A commit encapsulates information about a point in time at which the state of the repository is recorded, usually after a
change which is documented in the commit message
.
Fields
tree: &'a BStr
HEX hash of tree object we point to. Usually 40 bytes long.
Use tree()
to obtain a decoded version of it.
parents: SmallVec<[&'a BStr; 2]>
HEX hash of each parent commit. Empty for first commit in repository.
Who wrote this commit.
committer: SignatureRef<'a>
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<&'a BStr>
The name of the message encoding, otherwise UTF-8 should be assumed.
message: &'a BStr
The commit message documenting the change.
extra_headers: Vec<(&'a BStr, Cow<'a, BStr>)>
Extra header fields, in order of them being encountered, made accessible with the iterator returned by extra_headers()
.
Implementations
Return exactly the same message as MessageRef::summary()
.
pub fn message_trailers(&self) -> Trailers<'a>ⓘNotable traits for Trailers<'a>impl<'a> Iterator for Trailers<'a> type Item = TrailerRef<'a>;
pub fn message_trailers(&self) -> Trailers<'a>ⓘNotable traits for Trailers<'a>impl<'a> Iterator for Trailers<'a> type Item = TrailerRef<'a>;
impl<'a> Iterator for Trailers<'a> type Item = TrailerRef<'a>;
Return an iterator over message trailers as obtained from the last paragraph of the commit message. May be empty.
Deserialize a commit from the given data
bytes while avoiding most allocations.
Returns an iterator of parent object ids
Returns a convenient iterator over all extra headers.
Returns a partially parsed message from which more information can be derived.
Trait Implementations
fn 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
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl<'a> RefUnwindSafe for CommitRef<'a>
impl<'a> UnwindSafe for CommitRef<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more