pub struct Commit {
pub id: ObjectId,
pub parents: Vec<ObjectId>,
pub manifest: ObjectId,
pub message: String,
pub timestamp_unix: i64,
pub author: Option<Author>,
}Expand description
A commit: an immutable snapshot pointer plus history metadata.
id is the content hash of the serialized commit body (everything except
the id itself) and is therefore not persisted inside the commit object — it
is recovered from the storage key on read.
Fields§
§id: ObjectId§parents: Vec<ObjectId>§manifest: ObjectId§message: String§timestamp_unix: i64Commit author. None for legacy commits written before authors existed.
Implementations§
Source§impl Commit
impl Commit
Sourcepub fn body(&self) -> CommitBody
pub fn body(&self) -> CommitBody
Split a commit into its serializable body.
Sourcepub fn from_body(id: ObjectId, body: CommitBody) -> Self
pub fn from_body(id: ObjectId, body: CommitBody) -> Self
Reassemble a full commit from a stored body and its content id.
Trait Implementations§
impl Eq for Commit
impl StructuralPartialEq for Commit
Auto Trait Implementations§
impl Freeze for Commit
impl RefUnwindSafe for Commit
impl Send for Commit
impl Sync for Commit
impl Unpin for Commit
impl UnsafeUnpin for Commit
impl UnwindSafe for Commit
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more