pub struct VersionVector { /* private fields */ }Expand description
Per-replica contiguous prefixes for anti-entropy pulls.
get(replica) == n means every sequence 1..=n for that replica is known.
Later records that arrive before earlier records must not advance this
prefix, otherwise since could hide gaps.
Implementations§
Source§impl VersionVector
impl VersionVector
pub fn new() -> Self
pub fn get(&self, replica: u64) -> u64
Sourcepub fn observe(&mut self, id: RecordId)
pub fn observe(&mut self, id: RecordId)
Advance this prefix only when id is the next contiguous sequence.
Use EventLog to ingest out-of-order records; the log remembers gaps
and advances this vector once the prefix is complete.
pub fn includes(&self, id: RecordId) -> bool
pub fn entries(&self) -> &BTreeMap<u64, u64>
Trait Implementations§
Source§impl Clone for VersionVector
impl Clone for VersionVector
Source§fn clone(&self) -> VersionVector
fn clone(&self) -> VersionVector
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 VersionVector
impl Debug for VersionVector
Source§impl Default for VersionVector
impl Default for VersionVector
Source§fn default() -> VersionVector
fn default() -> VersionVector
Returns the “default value” for a type. Read more
impl Eq for VersionVector
Source§impl PartialEq for VersionVector
impl PartialEq for VersionVector
Source§fn eq(&self, other: &VersionVector) -> bool
fn eq(&self, other: &VersionVector) -> bool
Tests for
self and other values to be equal, and is used by ==.1.0.0 (const: unstable) · Source§fn ne(&self, other: &Rhs) -> bool
fn ne(&self, other: &Rhs) -> bool
Tests for
!=. The default implementation is almost always sufficient,
and should not be overridden without very good reason.impl StructuralPartialEq for VersionVector
Auto Trait Implementations§
impl Freeze for VersionVector
impl RefUnwindSafe for VersionVector
impl Send for VersionVector
impl Sync for VersionVector
impl Unpin for VersionVector
impl UnsafeUnpin for VersionVector
impl UnwindSafe for VersionVector
Blanket Implementations§
Source§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
Source§fn type_id(&self) -> TypeId
fn type_id(&self) -> TypeId
Gets the
TypeId of self. Read moreSource§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
Source§fn borrow(&self) -> &T
fn borrow(&self) -> &T
Immutably borrows from an owned value. Read more
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§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)Performs copy-assignment from
self to dest. Read moreSource§impl<T, U> Into<U> for Twhere
U: From<T>,
impl<T, U> Into<U> for Twhere
U: From<T>,
Source§fn into(self) -> U
fn into(self) -> U
Calls U::from(self).
That is, this conversion is whatever the implementation of
From<T> for U chooses to do.