pub struct LazyCommit<'graph> { /* 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> LazyCommit<'graph>

source

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

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 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> RefUnwindSafe for LazyCommit<'graph>

§

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

§

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

§

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

§

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

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>,

§

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>,

§

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.