pub struct RefTransaction { /* private fields */ }Expand description
Batch of ref updates prepared for super::RefStore::prepare.
Implementations§
Source§impl RefTransaction
impl RefTransaction
Sourcepub fn update(self, update: RefUpdate) -> Result<Self, RefStoreError>
pub fn update(self, update: RefUpdate) -> Result<Self, RefStoreError>
Append an update, rejecting duplicate ref names in the same batch.
§Errors
Returns RefStoreError::DuplicateUpdate when update.name was already queued.
Sourcepub fn push_update(&mut self, update: RefUpdate) -> Result<(), RefStoreError>
pub fn push_update(&mut self, update: RefUpdate) -> Result<(), RefStoreError>
Append an update in place.
§Errors
Returns RefStoreError::DuplicateUpdate when update.name was already queued.
Sourcepub fn into_updates(self) -> Vec<RefUpdate>
pub fn into_updates(self) -> Vec<RefUpdate>
Consume the transaction and return the update list.
Sourcepub fn reflog_renames(&self) -> &[RefReflogRename]
pub fn reflog_renames(&self) -> &[RefReflogRename]
Reflog rename operations bundled with this transaction.
Sourcepub fn case_only_renames(&self) -> &[RefCaseOnlyRename]
pub fn case_only_renames(&self) -> &[RefCaseOnlyRename]
Case-only ref renames bundled with this transaction.
Sourcepub fn with_reflog_rename(self, rename: RefReflogRename) -> Self
pub fn with_reflog_rename(self, rename: RefReflogRename) -> Self
Append a branch reflog rename to this transaction.
Sourcepub fn with_case_only_rename(self, rename: RefCaseOnlyRename) -> Self
pub fn with_case_only_rename(self, rename: RefCaseOnlyRename) -> Self
Append a case-only branch ref rename (files backend).
Sourcepub fn into_parts(
self,
) -> (Vec<RefUpdate>, Vec<RefReflogRename>, Vec<RefCaseOnlyRename>)
pub fn into_parts( self, ) -> (Vec<RefUpdate>, Vec<RefReflogRename>, Vec<RefCaseOnlyRename>)
Split into ref updates, reflog renames, and case-only ref renames.
Trait Implementations§
Source§impl Clone for RefTransaction
impl Clone for RefTransaction
Source§impl Debug for RefTransaction
impl Debug for RefTransaction
Source§impl Default for RefTransaction
impl Default for RefTransaction
impl Eq for RefTransaction
Source§impl PartialEq for RefTransaction
impl PartialEq for RefTransaction
impl StructuralPartialEq for RefTransaction
Auto Trait Implementations§
impl Freeze for RefTransaction
impl RefUnwindSafe for RefTransaction
impl Send for RefTransaction
impl Sync for RefTransaction
impl Unpin for RefTransaction
impl UnsafeUnpin for RefTransaction
impl UnwindSafe for RefTransaction
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