Trait mz_timestamp_oracle::TimestampOracle
source · pub trait TimestampOracle<T>: Debug {
// Required methods
fn write_ts<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = WriteTimestamp<T>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn peek_write_ts<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = T> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn read_ts<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = T> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn apply_write<'life0, 'async_trait>(
&'life0 self,
lower_bound: T,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
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.
Required Methods§
sourcefn write_ts<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = WriteTimestamp<T>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn write_ts<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = WriteTimestamp<T>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
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<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = T> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn peek_write_ts<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = T> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Peek the current write timestamp.
sourcefn read_ts<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = T> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn read_ts<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = T> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
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()
.