pub struct WriteVersion {
pub epoch: u64,
pub index: u64,
pub local: u64,
}Expand description
The position of the write that produced a row version, within one vShard.
A write that applies a data-group entry records epoch, the epoch at
which its vShard moved to the entry’s group, and index, the entry’s log
index. local is 0.
A write that applies no entry records its WAL LSN in local, on top of
the latest version its vShard holds on the core. Such a write exists on
one node only: a single-node write, or a local-only write on a cluster
node. It sorts after every version its vShard already holds and before
the next entry the vShard applies.
Versions compare only within one vShard. The writes of one vShard are
totally ordered by (epoch, index, local).
Fields§
§epoch: u64The epoch at which the vShard moved to the group that applied the
write. 0 while the vShard stays in its initial group.
index: u64The log index of the data-group entry that applied the write.
local: u64The WAL LSN of a write that applies no entry, 0 otherwise.
Implementations§
Source§impl WriteVersion
impl WriteVersion
Sourcepub const fn logged(epoch: u64, index: u64) -> Self
pub const fn logged(epoch: u64, index: u64) -> Self
The version of a write that applies the entry at index, in epoch.
Sourcepub const fn local_after(latest: Self, lsn: u64) -> Self
pub const fn local_after(latest: Self, lsn: u64) -> Self
The version of a write that applies no entry, at WAL LSN lsn, on a
vShard whose latest version is latest.
Sourcepub fn distance_above(self, older: Self) -> Option<u64>
pub fn distance_above(self, older: Self) -> Option<u64>
How far self sits above older in one epoch: the log entries
between them, or the WAL LSNs between two writes of one entry
position. None across epochs, or when older is not below self.
Trait Implementations§
Source§impl Archive for WriteVersion
impl Archive for WriteVersion
Source§const COPY_OPTIMIZATION: CopyOptimization<Self>
const COPY_OPTIMIZATION: CopyOptimization<Self>
serialize. Read moreSource§type Archived = ArchivedWriteVersion
type Archived = ArchivedWriteVersion
Source§type Resolver = WriteVersionResolver
type Resolver = WriteVersionResolver
Source§impl Clone for WriteVersion
impl Clone for WriteVersion
impl Copy for WriteVersion
Source§impl Debug for WriteVersion
impl Debug for WriteVersion
Source§impl Default for WriteVersion
impl Default for WriteVersion
Source§impl<'de> Deserialize<'de> for WriteVersion
impl<'de> Deserialize<'de> for WriteVersion
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<__D: Fallible + ?Sized> Deserialize<WriteVersion, __D> for Archived<WriteVersion>
impl<__D: Fallible + ?Sized> Deserialize<WriteVersion, __D> for Archived<WriteVersion>
Source§fn deserialize(
&self,
deserializer: &mut __D,
) -> Result<WriteVersion, <__D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut __D, ) -> Result<WriteVersion, <__D as Fallible>::Error>
impl Eq for WriteVersion
Source§impl<'__msgpack_de> FromMessagePack<'__msgpack_de> for WriteVersion
impl<'__msgpack_de> FromMessagePack<'__msgpack_de> for WriteVersion
Source§impl Hash for WriteVersion
impl Hash for WriteVersion
Source§impl Ord for WriteVersion
impl Ord for WriteVersion
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for WriteVersion
impl PartialEq for WriteVersion
Source§impl PartialOrd for WriteVersion
impl PartialOrd for WriteVersion
Source§impl Serialize for WriteVersion
impl Serialize for WriteVersion
impl StructuralPartialEq for WriteVersion
Source§impl ToMessagePack for WriteVersion
impl ToMessagePack for WriteVersion
Source§fn write<W: Write>(&self, writer: &mut W) -> Result<(), Error>
fn write<W: Write>(&self, writer: &mut W) -> Result<(), Error>
Source§fn size_hint(&self) -> Option<TrustedSizeHint>
fn size_hint(&self) -> Option<TrustedSizeHint>
Self::write, or None when it cannot be determined cheaply. Read moreAuto Trait Implementations§
impl Freeze for WriteVersion
impl RefUnwindSafe for WriteVersion
impl Send for WriteVersion
impl Sync for WriteVersion
impl Unpin for WriteVersion
impl UnsafeUnpin for WriteVersion
impl UnwindSafe for WriteVersion
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> ArchiveUnsized for Twhere
T: Archive,
impl<T> ArchiveUnsized for Twhere
T: Archive,
Source§type Archived = <T as Archive>::Archived
type Archived = <T as Archive>::Archived
Archive, it may be
unsized. Read moreSource§fn archived_metadata(
&self,
) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
fn archived_metadata( &self, ) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<T> FromMessagePackOwned for Twhere
T: for<'a> FromMessagePack<'a>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> Scalar for T
Source§impl<T, S> SerializeUnsized<S> for T
impl<T, S> SerializeUnsized<S> for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.