pub trait TimestampManipulation: Timestamp + TotalOrder + Lattice + Debug + StepForward {
    // 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;
}

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.

Object Safety§

This trait is not object safe.

Implementors§