pub struct Commit<'repo> {
    pub id: ObjectId,
    pub data: Vec<u8>,
    /* private fields */
}
Expand description

A decoded commit object with access to its owning repository.

Please note that the limitations described in Object apply here as well.

Fields

id: ObjectId

The id of the commit

data: Vec<u8>

The fully decoded commit data

Implementations

Create an owned instance of this object, copying our data in the process.

Sever the connection to the Repository and turn this instance into a standalone object.

Turn this objects id into a shortened id with a length in hex as configured by core.abbrev.

Parse the commits message into a MessageRef

Decode the entire commit object in full and return the raw message bytes.

Decode the commit and obtain the time at which the commit was created.

For the time at which it was authored, refer to .decode()?.author.time.

Decode the entire commit object and return it for accessing all commit information.

It will allocate only if there are more than 2 parents.

Note that the returned commit object does make lookup easy and should be used for successive calls to string-ish information to avoid decoding the object more than once.

Return an iterator over tokens, representing this commit piece by piece.

Return the commits author, with surrounding whitespace trimmed.

Return the commits committer. with surrounding whitespace trimmed.

Decode this commits parent ids on the fly without allocating.

Parse the commit and return the the tree object it points to.

Parse the commit and return the the tree id it points to.

Return our id own id with connection to this repository.

Obtain a platform for traversing ancestors of this commit.

Trait Implementations

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

Converts to this type from the input type.

Converts to this type from the input type.

The type returned in the event of a conversion error.

Performs the conversion.

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. 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.