feat: current state
validate / macos-arm64 (push) Canceled after 0s
validate / windows-x86_64 (push) Canceled after 0s

This commit is contained in:
Louis Frei
2026-08-13 20:18:30 +02:00
parent 42fc9ee2dc
commit 8dda5dcf23
42 changed files with 5155 additions and 82 deletions
+17 -1
View File
@@ -1 +1,17 @@
pub trait Clock {} pub struct SystemClock;
use async_trait::async_trait;
use std::time::{Duration, Instant};
#[async_trait]
pub trait Clock: Send + Sync {
fn now(&self) -> Instant;
async fn sleep(&self, duration: Duration);
}
pub struct SystemClock;
#[async_trait]
impl Clock for SystemClock {
fn now(&self) -> Instant {
Instant::now()
}
async fn sleep(&self, duration: Duration) {
tokio::time::sleep(duration).await;
}
}