lenso-platform-core 0.1.15

Core runtime primitives for the Lenso backend framework.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use chrono::{DateTime, Utc};
use std::fmt::Debug;
use std::sync::Arc;

pub trait Clock: Debug + Send + Sync {
    fn now(&self) -> DateTime<Utc>;
}

pub type DynClock = Arc<dyn Clock>;

#[derive(Debug, Default)]
pub struct SystemClock;

impl Clock for SystemClock {
    fn now(&self) -> DateTime<Utc> {
        Utc::now()
    }
}