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§

Provided Associated Constants§

source

const TIMESTAMP_VALID_BITS: u16 = _

Define how many bits are valid in timestamp, returned from now()

Required Associated Types§

source

type TimestampType: Copy + Sized

Numeric timestamp type, can be either u32 or u64.

Required Methods§

source

fn now() -> Self::TimestampType

Returns current timestamp from provider.

Object Safety§

This trait is not object safe.

Implementors§