scsys_core/time/traits/timestamp.rs
1/*
2 appellation: timestamp <module>
3 authors: @FL03
4*/
5
6/// a private trait used to mark types capable of being uses as a basetype for a [`Timestamp`].
7pub trait RawTimestamp {
8 private!();
9}
10
11/*
12 ************* Implementations *************
13*/
14macro_rules! impl_raw_timestamp {
15 ($($t:ty),* $(,)?) => {
16 $(
17 impl_raw_timestamp!(@impl $t);
18 )*
19 };
20 (@impl $T:ty) => {
21 impl RawTimestamp for $T {
22 seal!();
23 }
24 };
25}
26
27impl_raw_timestamp! {
28 u64,
29 u128,
30 i64,
31}
32
33impl RawTimestamp for str {
34 seal!();
35}
36
37#[cfg(feature = "alloc")]
38impl RawTimestamp for alloc::string::String {
39 seal!();
40}