TimestampProvider

Trait TimestampProvider 

Source
pub trait TimestampProvider {
    type Instant;

    // Required method
    fn now(&self) -> Self::Instant;
}
Expand description

Trait for adapters that provide current time information

Enables timing information for timestamping, performance measurement, and scheduling.

Required Associated Types§

Source

type Instant

Type representing an instant in time for this runtime

Required Methods§

Source

fn now(&self) -> Self::Instant

Gets the current timestamp according to the runtime’s time source

§Example
use aimdb_core::time::TimestampProvider;

fn log_operation<T: TimestampProvider>(provider: &T) {
    let _timestamp = provider.now();
    println!("Operation completed");
}

Implementors§