gix_revwalk::graph

Struct LazyCommit

source
pub struct LazyCommit<'graph, 'cache> { /* private fields */ }
Expand description

A commit that provides access to graph-related information, on demand.

The owned version of this type is called Commit and can be obtained by calling LazyCommit::to_owned().

Implementations§

source§

impl<'graph, 'cache> LazyCommit<'graph, 'cache>

source

pub fn iter_parents(&self) -> Parents<'graph, 'cache>

Return an iterator over the parents of this commit.

source

pub fn committer_timestamp(&self) -> Result<SecondsSinceUnixEpoch, Error>

Returns the timestamp at which this commit was created.

This is the single-most important date for determining recency of commits. Note that this can only fail if the commit is backed by the object database and parsing fails.

source

pub fn generation(&self) -> Option<Generation>

Returns the generation of the commit if it is backed by a commit graph.

source

pub fn generation_and_timestamp( &self, ) -> Result<(Option<Generation>, SecondsSinceUnixEpoch), Error>

Returns the generation of the commit and its commit-time, either from cache if available, or parsed from the object buffer.

source

pub fn to_owned<T>( &self, new_data: impl FnOnce() -> T, ) -> Result<Commit<T>, Error>

Convert ourselves into an owned version, which effectively detaches us from the underlying graph. Use new_data() to provide the data field for the owned Commit.

Auto Trait Implementations§

§

impl<'graph, 'cache> Freeze for LazyCommit<'graph, 'cache>

§

impl<'graph, 'cache> RefUnwindSafe for LazyCommit<'graph, 'cache>

§

impl<'graph, 'cache> Send for LazyCommit<'graph, 'cache>

§

impl<'graph, 'cache> Sync for LazyCommit<'graph, 'cache>

§

impl<'graph, 'cache> Unpin for LazyCommit<'graph, 'cache>

§

impl<'graph, 'cache> UnwindSafe for LazyCommit<'graph, 'cache>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where 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 T
where 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.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

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 T
where U: TryFrom<T>,

source§

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.