pub trait TimestampProvider {
type TimestampType: Copy + Sized + From<u64>;
const TIMESTAMP_VALID_BITS: u8 = _;
const MAX_VALUE: u64 = _;
// Required method
fn now() -> Self::TimestampType;
}
Expand description
TimestampProvider is a source for relatively stable timestamp, which wraps around after reaching maximum value.
Maximum value is defined as unsigned integer composed of TIMESTAMP_VALID_BITS binary ones.
Provided Associated Constants§
Sourceconst TIMESTAMP_VALID_BITS: u8 = _
const TIMESTAMP_VALID_BITS: u8 = _
Define how many bits are valid in timestamp, returned from now(). Other bits are zeroed.
Required Associated Types§
Required Methods§
Sourcefn now() -> Self::TimestampType
fn now() -> Self::TimestampType
Returns current timestamp from provider.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.