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.