Struct mz_adapter::coord::timeline::TimestampOracle
source · struct TimestampOracle<T> {
state: TimestampOracleState<T>,
next: Box<dyn Fn() -> T>,
}
Expand description
A type that provides write and read timestamps, reads observe exactly their preceding writes..
Specifically, all read timestamps will be greater or equal to all previously reported completed write timestamps, and strictly less than all subsequently emitted write timestamps.
Fields§
§state: TimestampOracleState<T>
§next: Box<dyn Fn() -> T>
Implementations§
source§impl<T: TimestampManipulation> TimestampOracle<T>
impl<T: TimestampManipulation> TimestampOracle<T>
sourcepub fn new<F>(initially: T, next: F) -> Selfwhere
F: Fn() -> T + 'static,
pub fn new<F>(initially: T, next: F) -> Selfwhere F: Fn() -> T + 'static,
Create a new timeline, starting at the indicated time. next
generates
new timestamps when invoked. The timestamps have no requirements, and can
retreat from previous invocations.
sourcefn write_ts(&mut self) -> WriteTimestamp<T>
fn write_ts(&mut self) -> WriteTimestamp<T>
Acquire a new timestamp for writing.
This timestamp will be strictly greater than all prior values of
self.read_ts()
and self.write_ts()
.
sourcefn peek_write_ts(&self) -> T
fn peek_write_ts(&self) -> T
Peek the current write timestamp.
sourcefn read_ts(&self) -> T
fn read_ts(&self) -> T
Acquire a new timestamp for reading.
This timestamp will be greater or equal to all prior values of self.apply_write(write_ts)
,
and strictly less than all subsequent values of self.write_ts()
.
sourcefn apply_write(&mut self, write_ts: T)
fn apply_write(&mut self, write_ts: T)
Mark a write at write_ts
completed.
All subsequent values of self.read_ts()
will be greater or equal to write_ts
.
Auto Trait Implementations§
impl<T> !RefUnwindSafe for TimestampOracle<T>
impl<T> !Send for TimestampOracle<T>
impl<T> !Sync for TimestampOracle<T>
impl<T> Unpin for TimestampOracle<T>where T: Unpin,
impl<T> !UnwindSafe for TimestampOracle<T>
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> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request
source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
impl<P, R> ProtoType<R> for Pwhere R: RustType<P>,
source§fn into_rust(self) -> Result<R, TryFromProtoError>
fn into_rust(self) -> Result<R, TryFromProtoError>
RustType::from_proto
.source§fn from_rust(rust: &R) -> P
fn from_rust(rust: &R) -> P
RustType::into_proto
.