pub trait Timestamp {
    type Duration: PartialOrd;
    type Error;

    fn now() -> Self;
    fn duration_since_epoch(self) -> Self::Duration;
    fn duration_since(&self, other: &Self) -> Result<Self::Duration, Self::Error>;
}
Expand description

Represents a timestamp.

Required Associated Types§

Required Methods§

Get current timestamp.

Get duration since start.

Get duration since other.

Errors

This function will return an error if duration between other-self timestamps is negative.

Implementors§