icydb_base/types/
time.rs

1use crate::prelude::*;
2
3///
4/// CreatedAt
5/// if zero gets sanitized to the current Timestamp
6///
7
8#[newtype(
9    primitive = "Timestamp",
10    item(prim = "Timestamp"),
11    ty(sanitizer(path = "sanitizer::time::CreatedAt"))
12)]
13pub struct CreatedAt {}
14
15///
16/// UpdatedAt
17/// always gets sanitized to the current Timestamp
18///
19
20#[newtype(
21    primitive = "Timestamp",
22    item(prim = "Timestamp"),
23    ty(sanitizer(path = "sanitizer::time::UpdatedAt"))
24)]
25pub struct UpdatedAt {}
26
27///
28/// Milliseconds
29///
30
31#[newtype(primitive = "Nat64", item(prim = "Nat64"))]
32pub struct Milliseconds {}
33
34///
35/// Seconds
36///
37
38#[newtype(primitive = "Nat64", item(prim = "Nat64"))]
39pub struct Seconds {}
40
41///
42/// Minutes
43///
44
45#[newtype(primitive = "Nat64", item(prim = "Nat64"))]
46pub struct Minutes {}