pub struct RefTransactionItem {
pub name: String,
pub new_oid: Option<ObjectId>,
pub expected_old: Option<ObjectId>,
}Expand description
A single ref change in an update_refs batch transaction.
Fields§
§name: StringFull ref name (e.g. refs/heads/main).
new_oid: Option<ObjectId>New value to write, or None to delete the ref.
expected_old: Option<ObjectId>Compare-and-swap expectation. When Some, the ref’s current value must
equal this for the item to apply (an expected_old of an oid that is not
the current value — including when the ref is absent — fails the batch).
When None, the current value is not checked.
Note: this CAS form expects the ref to currently hold expected_old. To
require that a ref be created (must not already exist), leave this
None — callers that need create-only semantics check existence
themselves; matching jj’s transaction model where None means “any”.
Trait Implementations§
Source§impl Clone for RefTransactionItem
impl Clone for RefTransactionItem
Source§fn clone(&self) -> RefTransactionItem
fn clone(&self) -> RefTransactionItem
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RefTransactionItem
impl RefUnwindSafe for RefTransactionItem
impl Send for RefTransactionItem
impl Sync for RefTransactionItem
impl Unpin for RefTransactionItem
impl UnsafeUnpin for RefTransactionItem
impl UnwindSafe for RefTransactionItem
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