cartulary 0.3.0-alpha.1

The knowledge layer of your project — decisions, issues, docs, all in one place.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Port: read wall-clock state.
//!
//! Domain code does not call `chrono::Utc::now()` directly; instead it
//! receives a clock from infra. The `cartu` CLI wires
//! [`SystemClock`](crate::infra::driven::clock::SystemClock); tests can
//! supply their own stub for deterministic time.

use crate::domain::model::temporal::iso_date::IsoDate;
use crate::domain::model::temporal::timestamp::Timestamp;

pub trait Clock {
    /// Current UTC instant, truncated to seconds.
    fn now(&self) -> Timestamp;

    /// Today's calendar date in the user's local timezone.
    fn today_local(&self) -> IsoDate;
}