Trait sparkles_core::timestamp::TimestampProvider
source · pub trait TimestampProvider {
type TimestampType: Copy + Sized;
const COUNTS_PER_NS: f64;
const TIMESTAMP_VALID_BITS: u16 = _;
// 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.
Required Associated Constants§
const COUNTS_PER_NS: f64
Provided Associated Constants§
sourceconst TIMESTAMP_VALID_BITS: u16 = _
const TIMESTAMP_VALID_BITS: u16 = _
Define how many bits are valid in timestamp, returned from now()
Required Associated Types§
sourcetype TimestampType: Copy + Sized
type TimestampType: Copy + Sized
Numeric timestamp type, can be either u32 or u64.
Required Methods§
sourcefn now() -> Self::TimestampType
fn now() -> Self::TimestampType
Returns current timestamp from provider.
Object Safety§
This trait is not object safe.