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§

source

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().

source

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.

source

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().

source

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,

Mark a write at write_ts completed.

All subsequent values of self.read_ts() will be greater or equal to write_ts.

Implementors§