pub struct DetachedCommitBuilder { /* private fields */ }
Expand description
Like CommitBuilder
, but doesn’t mutably borrow MutableRepo
.
Implementations§
Source§impl DetachedCommitBuilder
impl DetachedCommitBuilder
Sourcepub fn attach(self, mut_repo: &mut MutableRepo) -> CommitBuilder<'_>
pub fn attach(self, mut_repo: &mut MutableRepo) -> CommitBuilder<'_>
Attaches the underlying mut_repo
.
pub fn parents(&self) -> &[CommitId]
pub fn set_parents(&mut self, parents: Vec<CommitId>) -> &mut Self
pub fn predecessors(&self) -> &[CommitId]
pub fn set_predecessors(&mut self, predecessors: Vec<CommitId>) -> &mut Self
pub fn tree_id(&self) -> &MergedTreeId
pub fn set_tree_id(&mut self, tree_id: MergedTreeId) -> &mut Self
Sourcepub fn is_empty(&self, repo: &dyn Repo) -> BackendResult<bool>
pub fn is_empty(&self, repo: &dyn Repo) -> BackendResult<bool>
Commit::is_empty()
for the new commit.
pub fn change_id(&self) -> &ChangeId
pub fn set_change_id(&mut self, change_id: ChangeId) -> &mut Self
pub fn generate_new_change_id(&mut self) -> &mut Self
pub fn description(&self) -> &str
pub fn set_description(&mut self, description: impl Into<String>) -> &mut Self
pub fn committer(&self) -> &Signature
pub fn set_committer(&mut self, committer: Signature) -> &mut Self
Sourcepub fn is_discardable(&self, repo: &dyn Repo) -> BackendResult<bool>
pub fn is_discardable(&self, repo: &dyn Repo) -> BackendResult<bool>
Commit::is_discardable()
for the new commit.
pub fn sign_settings(&self) -> &SignSettings
pub fn set_sign_behavior(&mut self, sign_behavior: SignBehavior) -> &mut Self
pub fn set_sign_key(&mut self, sign_key: String) -> &mut Self
pub fn clear_sign_key(&mut self) -> &mut Self
Sourcepub fn write(self, mut_repo: &mut MutableRepo) -> BackendResult<Commit>
pub fn write(self, mut_repo: &mut MutableRepo) -> BackendResult<Commit>
Writes new commit and makes it visible in the mut_repo
.
Writes new commit without making it visible in the repo.
This does not consume the builder, so you can reuse the current configuration to create another commit later.
Sourcepub fn abandon(self, mut_repo: &mut MutableRepo)
pub fn abandon(self, mut_repo: &mut MutableRepo)
Records the old commit as abandoned in the mut_repo
.
This is noop if there’s no old commit that would be rewritten to the new
commit by write()
.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DetachedCommitBuilder
impl !RefUnwindSafe for DetachedCommitBuilder
impl Send for DetachedCommitBuilder
impl Sync for DetachedCommitBuilder
impl Unpin for DetachedCommitBuilder
impl !UnwindSafe for DetachedCommitBuilder
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> 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