Skip to main content

CommitData

Struct CommitData 

Source
pub struct CommitData {
    pub tree: ObjectId,
    pub parents: Vec<ObjectId>,
    pub author: String,
    pub committer: String,
    pub author_raw: Vec<u8>,
    pub committer_raw: Vec<u8>,
    pub encoding: Option<String>,
    pub message: String,
    pub raw_message: Option<Vec<u8>>,
    pub extra_headers: Vec<u8>,
}
Expand description

Parsed representation of a commit object.

This is the read-side shape (it round-trips stored bytes exactly). To create a new commit, build a NewCommit and pass it to Objects::write_commit.

Fields§

§tree: ObjectId

The tree this commit points to.

§parents: Vec<ObjectId>

Parent commit IDs (zero or more).

§author: String

Author field decoded to Unicode (using encoding when present, else UTF-8).

§committer: String

Committer field decoded to Unicode.

§author_raw: Vec<u8>

Exact author header payload bytes as stored in the object (after author ).

Empty means treat Self::author as UTF-8 when serializing (new commits).

§committer_raw: Vec<u8>

Exact committer header payload bytes as stored in the object.

§encoding: Option<String>

Optional encoding override (e.g. "UTF-8").

§message: String

Commit message (everything after the blank line).

§raw_message: Option<Vec<u8>>

Optional raw message bytes for non-UTF-8 commit messages. When set, serialize_commit uses these bytes instead of message. Optional raw message bytes for non-UTF-8 messages.

§extra_headers: Vec<u8>

Raw bytes for headers not represented in the fields above (gpgsig, mergetag, …), including each line’s trailing \n and any continuation lines (leading space).

serialize_commit always emits tree, parent, author, committer, and encoding from the structured fields, then appends these bytes before the blank line and message.

Trait Implementations§

Source§

impl Clone for CommitData

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CommitData

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for CommitData

Source§

impl PartialEq for CommitData

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for CommitData

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.