Struct git_object::mutable::Commit[][src]

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)>,
}

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.

author: Signature

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

impl Commit[src]

pub fn extra_headers(
    &self
) -> ExtraHeaders<impl Iterator<Item = (&BStr, &BStr)>>
[src]

Returns a convenient iterator over all extra headers.

pub fn write_to(&self, out: impl Write) -> Result<()>[src]

Serializes this instance to out in the git serialization format.

Trait Implementations

impl Clone for Commit[src]

impl Debug for Commit[src]

impl<'de> Deserialize<'de> for Commit[src]

impl Eq for Commit[src]

impl From<Commit<'_>> for Commit[src]

impl From<Commit> for Object[src]

impl Hash for Commit[src]

impl Ord for Commit[src]

impl PartialEq<Commit> for Commit[src]

impl PartialOrd<Commit> for Commit[src]

impl Serialize for Commit[src]

impl StructuralEq for Commit[src]

impl StructuralPartialEq for Commit[src]

impl TryFrom<Object> for Commit[src]

type Error = Object

The type returned in the event of a conversion error.

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

impl<T> Conv for T

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> TryConv for T

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.