pub struct Commit<'a> { /* private fields */ }Expand description
A commit’s root tree and exact message bytes. This checks the root header and header/message separator, not identity semantics or graph reachability.
Implementations§
Source§impl<'a> Commit<'a>
impl<'a> Commit<'a>
pub fn parse(data: &'a [u8]) -> Result<Self>
pub fn parse_with_format(data: &'a [u8], format: ObjectFormat) -> Result<Self>
Sourcepub fn root_tree(data: &[u8]) -> Result<ObjectId>
pub fn root_tree(data: &[u8]) -> Result<ObjectId>
Read just the first, canonical root-tree header.
pub fn root_tree_with_format( data: &[u8], format: ObjectFormat, ) -> Result<ObjectId>
pub fn tree(&self) -> ObjectId
pub fn message(&self) -> &'a [u8]
pub fn message_offset(&self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Commit<'a>
impl<'a> RefUnwindSafe for Commit<'a>
impl<'a> Send for Commit<'a>
impl<'a> Sync for Commit<'a>
impl<'a> Unpin for Commit<'a>
impl<'a> UnsafeUnpin for Commit<'a>
impl<'a> UnwindSafe for Commit<'a>
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