pub enum VersionedMapUpdate {
Applied {
previous: Option<MapVersionId>,
current: MapVersion,
},
Unchanged {
current: Option<MapVersion>,
},
Conflict {
current: Option<MapVersion>,
},
}Expand description
Outcome of a compare-and-update operation.
Variants§
Applied
The update committed and produced this version.
Fields
§
previous: Option<MapVersionId>Previous head, or None when the index was initialized.
§
current: MapVersionNew current version.
Unchanged
The requested mutations did not change the current tree.
Fields
§
current: Option<MapVersion>Current version, or None for an absent index and an empty edit.
Conflict
The caller’s expected head did not match the current head.
Fields
§
current: Option<MapVersion>Current head at the time the conflict was observed.
Implementations§
Source§impl VersionedMapUpdate
impl VersionedMapUpdate
Sourcepub fn current(&self) -> Option<&MapVersion>
pub fn current(&self) -> Option<&MapVersion>
Return the resulting current version for applied or unchanged updates.
Sourcepub fn is_applied(&self) -> bool
pub fn is_applied(&self) -> bool
Whether a new head was committed.
Sourcepub fn is_conflict(&self) -> bool
pub fn is_conflict(&self) -> bool
Whether the caller’s expected head was stale.
Trait Implementations§
Source§impl Clone for VersionedMapUpdate
impl Clone for VersionedMapUpdate
Source§fn clone(&self) -> VersionedMapUpdate
fn clone(&self) -> VersionedMapUpdate
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 VersionedMapUpdate
impl Debug for VersionedMapUpdate
Source§impl PartialEq for VersionedMapUpdate
impl PartialEq for VersionedMapUpdate
impl StructuralPartialEq for VersionedMapUpdate
Auto Trait Implementations§
impl Freeze for VersionedMapUpdate
impl RefUnwindSafe for VersionedMapUpdate
impl Send for VersionedMapUpdate
impl Sync for VersionedMapUpdate
impl Unpin for VersionedMapUpdate
impl UnsafeUnpin for VersionedMapUpdate
impl UnwindSafe for VersionedMapUpdate
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more