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 PartialEq for Change
impl PartialEq for Change
source§impl PartialOrd for Change
impl PartialOrd for Change
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more