Struct gix::revision::walk::Info

source ·
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>

Access

source

pub fn id(&self) -> Id<'repo>

Provide an attached version of our id field.

source

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.

source

pub fn parent_ids(&self) -> impl Iterator<Item = Id<'repo>> + '_

Provide an iterator yielding attached versions of our parent_ids field.

source

pub fn commit_time(&self) -> SecondsSinceUnixEpoch

Returns the commit-time of this commit.

Panics

If the iteration wasn’t ordered by date.

source§

impl<'repo> Info<'repo>

Initialization and detachment

source

pub fn new(info: Info, repo: &'repo Repository) -> Self

Create a new instance that represents info, but is attached to repo as well.

source

pub fn detach(self) -> Info

Consume this instance and remove the reference to the underlying repository.

This is useful for sending instances across threads, for example.

Trait Implementations§

source§

impl<'repo> Clone for Info<'repo>

source§

fn clone(&self) -> Info<'repo>

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl<'repo> Debug for Info<'repo>

source§

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

Formats the value using the given formatter. Read more

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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.