Enum gix_ref::transaction::Change
source · pub enum Change {
Update {
log: LogChange,
expected: PreviousValue,
new: Target,
},
Delete {
expected: PreviousValue,
log: RefLog,
},
}
Expand description
A description of an edit to perform.
Variants§
Update
If previous is not None
, the ref must exist and its oid
must agree with the previous
, and
we function like update
.
Otherwise it functions as create-or-update
.
Fields
expected: PreviousValue
The expected value already present in the reference.
If a ref was existing previously this field will be overwritten with MustExistAndMatch(actual_value)
for use after
the transaction was committed successfully.
Delete
Delete a reference and optionally check if previous
is its content.
Fields
expected: PreviousValue
The expected value of the reference, with the MustNotExist
variant being invalid.
If a previous ref existed, this value will be filled in automatically as MustExistAndMatch(actual_value)
and
can be accessed if the transaction was committed successfully.
Implementations§
source§impl Change
impl Change
sourcepub fn new_value(&self) -> Option<TargetRef<'_>>
pub fn new_value(&self) -> Option<TargetRef<'_>>
Return references to values that are the new value after the change is applied, if this is an update.
sourcepub fn previous_value(&self) -> Option<TargetRef<'_>>
pub fn previous_value(&self) -> Option<TargetRef<'_>>
Return references to values that are in common between all variants and denote the previous observed value.
Trait Implementations§
source§impl Ord for Change
impl Ord for Change
source§impl PartialOrd for Change
impl PartialOrd for Change
impl Eq for Change
impl StructuralPartialEq for Change
Auto Trait Implementations§
impl Freeze for Change
impl RefUnwindSafe for Change
impl Send for Change
impl Sync for Change
impl Unpin for Change
impl UnwindSafe for Change
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)