feat: add main features
Agents for developpement added + frontend add + backend added. Git viewer created + agent and template creator + layout and project creator
This commit is contained in:
27
crates/infrastructure/src/clock/mod.rs
Normal file
27
crates/infrastructure/src/clock/mod.rs
Normal file
@ -0,0 +1,27 @@
|
||||
//! [`SystemClock`] — production [`Clock`] backed by the system wall clock.
|
||||
|
||||
use std::time::{SystemTime, UNIX_EPOCH};
|
||||
|
||||
use domain::ports::Clock;
|
||||
|
||||
/// Real clock returning the current epoch time in milliseconds.
|
||||
#[derive(Debug, Default, Clone, Copy)]
|
||||
pub struct SystemClock;
|
||||
|
||||
impl SystemClock {
|
||||
/// Creates a new [`SystemClock`].
|
||||
#[must_use]
|
||||
pub const fn new() -> Self {
|
||||
Self
|
||||
}
|
||||
}
|
||||
|
||||
impl Clock for SystemClock {
|
||||
fn now_millis(&self) -> i64 {
|
||||
// Saturating cast is fine: epoch millis fits in i64 until year 292M.
|
||||
SystemTime::now()
|
||||
.duration_since(UNIX_EPOCH)
|
||||
.map(|d| d.as_millis() as i64)
|
||||
.unwrap_or(0)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user