pub struct TimestampOracle<T> {
    state: TimestampOracleState<T>,
    advance_to: Option<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 write timestamps, and strictly less than all subsequently emitted write timestamps.

Fields

state: TimestampOracleState<T>advance_to: Option<T>next: Box<dyn Fn() -> T>

Implementations

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.

Peek the current value of the timestamp.

No operations should be assigned to the timestamp returned by this function. The timestamp returned should only be used to compare the progress of the TimestampOracle against some external source of time.

Subsequent values of self.read_ts() and self.write_ts() will be greater or equal to this timestamp.

NOTE: This can be removed once DDL is included in group commits.

Acquire a new timestamp for writing.

This timestamp will be strictly greater than all prior values of self.read_ts(), and less than or equal to all subsequent values of self.read_ts().

Acquire a new timestamp for reading.

This timestamp will be greater or equal to all prior values of self.write_ts(), and strictly less than all subsequent values of self.write_ts().

Electively advance the tracked times.

If lower_bound is strictly greater than the current time (of either state), the resulting state will be Writing(lower_bound).

Whether and to what the next value of `self.write_ts() has advanced since this method was last called.

This method may produce the same value multiple times, and should not be used as a test for whether a write-to-read transition has occurred, so much as an advisory signal that write capabilities can advance.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Attaches the provided Context to this type, returning a WithContext wrapper. Read more

Attaches the current Context to this type, returning a WithContext wrapper. Read more

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Wrap the input message T in a tonic::Request

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more