pub struct CompareAndSwap<'swap> {
pub target_ref: &'swap str,
pub detached: bool,
pub nonce: &'swap str,
pub new_oid: &'swap str,
pub expected_old: &'swap Base,
pub hash_length: usize,
}Expand description
What: One compare-and-swap of a landing’s target. Why: Grouping the facts keeps the call site readable and names what the swap depends on.
In TS you’d write (pseudocode):
{ targetRef, symbolicHead, transactionId, newOid, expectedOld, emptyTreeOid }Fields§
§target_ref: &'swap strRef to move: the branch, or HEAD when detached.
detached: boolWhether HEAD is detached, so --no-deref moves HEAD itself.
nonce: &'swap strTransaction ID written into the reflog message.
new_oid: &'swap strCommit to land.
expected_old: &'swap BaseValue the target must still hold.
hash_length: usizeHash length in hex digits, which sets the width of the all-zero unborn value.
Auto Trait Implementations§
impl<'swap> Freeze for CompareAndSwap<'swap>
impl<'swap> RefUnwindSafe for CompareAndSwap<'swap>
impl<'swap> Send for CompareAndSwap<'swap>
impl<'swap> Sync for CompareAndSwap<'swap>
impl<'swap> Unpin for CompareAndSwap<'swap>
impl<'swap> UnsafeUnpin for CompareAndSwap<'swap>
impl<'swap> UnwindSafe for CompareAndSwap<'swap>
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