Enum git_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
Fields
log: LogChange
The desired change to the reference log.
expected: PreviousValue
The expected value already present in the reference.
If a ref was existing previously it will be overwritten at MustExistAndMatch(actual_value)
for use after
the transaction was committed successfully.
new: Target
The new state of the reference, either for updating an existing one or creating a new one.
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
.
Delete
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.
log: RefLog
How to treat the reference log during deletion.
Delete a reference and optionally check if previous
is its content.
Implementations
Trait Implementations
sourceimpl Ord for Change
impl Ord for Change
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
sourceimpl PartialOrd<Change> for Change
impl PartialOrd<Change> for Change
sourcefn partial_cmp(&self, other: &Change) -> Option<Ordering>
fn partial_cmp(&self, other: &Change) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more