pub struct Info<'repo> {
pub id: ObjectId,
pub parent_ids: ParentIds,
pub commit_time: Option<SecondsSinceUnixEpoch>,
/* private fields */
}
Expand description
Information about a commit that we obtained naturally as part of the iteration.
Fields§
§id: ObjectId
The detached id of the commit.
parent_ids: ParentIds
All parent ids we have encountered. Note that these will be at most one if Parents::First
is enabled.
commit_time: Option<SecondsSinceUnixEpoch>
The time at which the commit was created. It’s only Some(_)
if sorting is not Sorting::BreadthFirst
,
as the walk needs to require the commit-date.
Implementations§
source§impl<'repo> Info<'repo>
impl<'repo> Info<'repo>
Access
sourcepub fn object(&self) -> Result<Commit<'repo>, Error>
pub fn object(&self) -> Result<Commit<'repo>, Error>
Read the whole object from the object database.
Note that this is an expensive operation which shouldn’t be performed unless one needs more than parent ids and commit time.
sourcepub fn parent_ids(&self) -> impl Iterator<Item = Id<'repo>> + '_
pub fn parent_ids(&self) -> impl Iterator<Item = Id<'repo>> + '_
Provide an iterator yielding attached versions of our parent_ids
field.
sourcepub fn commit_time(&self) -> SecondsSinceUnixEpoch
pub fn commit_time(&self) -> SecondsSinceUnixEpoch
Trait Implementations§
Auto Trait Implementations§
impl<'repo> !RefUnwindSafe for Info<'repo>
impl<'repo> !Send for Info<'repo>
impl<'repo> !Sync for Info<'repo>
impl<'repo> Unpin for Info<'repo>
impl<'repo> !UnwindSafe for Info<'repo>
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