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.

author: SignatureRef<'a>

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().

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.

Return the tree fields hash digest.

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Performs the conversion.

Performs the conversion.

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Serialize this value into the given Serde serializer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

Serializes this instance to out in the git serialization format.

Returns the type of this object.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.