Trait mz_repr::timestamp::TimestampManipulation

source ·
pub trait TimestampManipulation:
    Timestamp
    + TotalOrder
    + Lattice
    + Debug
    + StepForward
    + Sync {
    // Required methods
    fn step_forward(&self) -> Self;
    fn step_forward_by(&self, amount: &Self) -> Self;
    fn try_step_forward_by(&self, amount: &Self) -> Option<Self>;
    fn try_step_forward(&self) -> Option<Self>;
    fn step_back(&self) -> Option<Self>;
    fn maximum() -> Self;
    fn round_up(&self, schedule: &RefreshSchedule) -> Option<Self>;
    fn round_down_minus_1(&self, schedule: &RefreshSchedule) -> Option<Self>;
}

Required Methods§

source

fn step_forward(&self) -> Self

Advance a timestamp by the least amount possible such that ts.less_than(ts.step_forward()) is true. Panic if unable to do so.

source

fn step_forward_by(&self, amount: &Self) -> Self

Advance a timestamp forward by the given amount. Panic if unable to do so.

source

fn try_step_forward_by(&self, amount: &Self) -> Option<Self>

Advance a timestamp forward by the given amount. Return None if unable to do so.

source

fn try_step_forward(&self) -> Option<Self>

Advance a timestamp by the least amount possible such that ts.less_than(ts.step_forward()) is true. Return None if unable to do so.

source

fn step_back(&self) -> Option<Self>

Retreat a timestamp by the least amount possible such that ts.step_back().unwrap().less_than(ts) is true. Return None if unable, which must only happen if the timestamp is Timestamp::minimum().

source

fn maximum() -> Self

Return the maximum value for this timestamp.

source

fn round_up(&self, schedule: &RefreshSchedule) -> Option<Self>

Rounds up the timestamp to the time of the next refresh according to the given schedule. Returns None if there is no next refresh.

source

fn round_down_minus_1(&self, schedule: &RefreshSchedule) -> Option<Self>

Rounds down timestamp - 1 to the time of the previous refresh according to the given schedule. Returns None if there is no previous refresh.

Object Safety§

This trait is not object safe.

Implementors§