pub struct UpdatedAtStamper { /* private fields */ }Expand description
A cloneable handle that mints _updated_at register values from a shared
Hlc — the register-stamping capability, sliced off the whole
[crate::sync::sync_manager::SyncManager].
coven creates this handle during open and injects it into the write path
before any [crate::sync::sync_manager::SyncManager] exists. The manager,
built later, borrows the same Arc<Hlc>: coven advances that clock past every
pulled row, and because the stamper shares the instance, that advance reaches
every [crate::SqlContext::stamp] call, so a later local write never
sorts behind a pulled row and loses last-writer-wins. Every clone shares one
Arc<Hlc>, so coven’s seeding and advance-on-pull are reflected in every
stamp.
It exposes only UpdatedAtStamper::stamp — never seed/advance_past/
high_water. Those drive the clock and are coven’s alone; the host write
path is a pure consumer of stamps and must not poke clock state.
Implementations§
Source§impl UpdatedAtStamper
impl UpdatedAtStamper
pub fn new(hlc: Arc<Hlc>) -> UpdatedAtStamper
Sourcepub fn stamp(&self) -> String
pub fn stamp(&self) -> String
Mint the next _updated_at register value for a synced-row write. The
returned string is an opaque HLC stamp; the host binds it into the write
and must not parse or compare it as a wall-clock time.
Sourcepub fn for_test() -> UpdatedAtStamper
pub fn for_test() -> UpdatedAtStamper
A standalone stamper over a fresh in-memory HLC, for tests that need a real stamper without opening coven. Not for production — production stampers come from the open path so they share the seeded, pull-advanced clock.
Trait Implementations§
Source§impl Clone for UpdatedAtStamper
impl Clone for UpdatedAtStamper
Source§fn clone(&self) -> UpdatedAtStamper
fn clone(&self) -> UpdatedAtStamper
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for UpdatedAtStamper
impl !RefUnwindSafe for UpdatedAtStamper
impl Send for UpdatedAtStamper
impl Sync for UpdatedAtStamper
impl Unpin for UpdatedAtStamper
impl UnsafeUnpin for UpdatedAtStamper
impl !UnwindSafe for UpdatedAtStamper
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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