pub enum RefPrecondition {
Any,
MustExist,
MustNotExist,
MustExistAndMatch(RefTarget),
ExistingMustMatch(RefTarget),
}Expand description
The compare-and-swap precondition a ref update is checked against (re-verified while the ref is locked, so it is a true CAS, not a check-then-write).
RefUpdate::expected can express Any (None) and
MustExistAndMatch (Some); the
create-only and match-or-create modes are reachable via
FileRefTransaction::update_to.
Variants§
Any
No precondition: create or overwrite unconditionally.
MustExist
The ref must currently exist (with any value).
MustNotExist
The ref must currently not exist (create-only).
MustExistAndMatch(RefTarget)
The ref must currently exist and point exactly at this target.
ExistingMustMatch(RefTarget)
If the ref exists it must point exactly at this target; if it is absent, the update is still allowed (match-or-create).
Trait Implementations§
Source§impl Clone for RefPrecondition
impl Clone for RefPrecondition
Source§fn clone(&self) -> RefPrecondition
fn clone(&self) -> RefPrecondition
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RefPrecondition
impl Debug for RefPrecondition
impl Eq for RefPrecondition
Source§impl PartialEq for RefPrecondition
impl PartialEq for RefPrecondition
Source§fn eq(&self, other: &RefPrecondition) -> bool
fn eq(&self, other: &RefPrecondition) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for RefPrecondition
Auto Trait Implementations§
impl Freeze for RefPrecondition
impl RefUnwindSafe for RefPrecondition
impl Send for RefPrecondition
impl Sync for RefPrecondition
impl Unpin for RefPrecondition
impl UnsafeUnpin for RefPrecondition
impl UnwindSafe for RefPrecondition
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