pub struct Commit { /* private fields */ }
Implementations§
source§impl Commit
impl Commit
pub fn new(store: Arc<Store>, id: CommitId, data: Arc<Commit>) -> Self
pub fn store(&self) -> &Arc<Store>
pub fn id(&self) -> &CommitId
pub fn parent_ids(&self) -> &[CommitId]
pub fn parents(&self) -> impl Iterator<Item = BackendResult<Commit>> + '_
pub fn predecessor_ids(&self) -> &[CommitId]
pub fn predecessors(&self) -> impl Iterator<Item = BackendResult<Commit>> + '_
pub fn tree(&self) -> BackendResult<MergedTree>
pub fn tree_id(&self) -> &MergedTreeId
sourcepub fn parent_tree(&self, repo: &dyn Repo) -> BackendResult<MergedTree>
pub fn parent_tree(&self, repo: &dyn Repo) -> BackendResult<MergedTree>
Return the parent tree, merging the parent trees if there are multiple parents.
sourcepub fn is_empty(&self, repo: &dyn Repo) -> BackendResult<bool>
pub fn is_empty(&self, repo: &dyn Repo) -> BackendResult<bool>
Returns whether commit’s content is empty. Commit description is not taken into consideration.
pub fn has_conflict(&self) -> BackendResult<bool>
pub fn change_id(&self) -> &ChangeId
pub fn store_commit(&self) -> &Commit
pub fn description(&self) -> &str
pub fn committer(&self) -> &Signature
sourcepub fn is_discardable(&self, repo: &dyn Repo) -> BackendResult<bool>
pub fn is_discardable(&self, repo: &dyn Repo) -> BackendResult<bool>
A commit is discardable if it has no change from its parent, and an empty description.
sourcepub fn verification(&self) -> SignResult<Option<Verification>>
pub fn verification(&self) -> SignResult<Option<Verification>>
A slow (but cached) way to get the full verification.
Trait Implementations§
source§impl Ord for Commit
impl Ord for Commit
source§impl PartialOrd for Commit
impl PartialOrd for Commit
impl Eq for Commit
Auto Trait Implementations§
impl Freeze for Commit
impl !RefUnwindSafe for Commit
impl Send for Commit
impl Sync for Commit
impl Unpin for Commit
impl !UnwindSafe for Commit
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more