1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/*!
A few extra typenum types that are useful.
*/

use typenum::consts::*;
use typenum::int::PInt;
use typenum::uint::{UInt, UTerm};

// --------------------------------
// typenum extension
// --------------------------------

// 3600 = 60 * 60 = 111000010000
/// Seconds in an Hour
pub type U3600 = UInt<
    UInt<
        UInt<
            UInt<
                UInt<
                    UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B0>, B0>, B0>, B0>,
                    B1,
                >,
                B0,
            >,
            B0,
        >,
        B0,
    >,
    B0,
>;
/// Seconds in an Hour
pub type P3600 = PInt<U3600>;

// 86_400 = 60 * 60 * 24 = 10101000110000000
/// Seconds in a Day
pub type U86400 = UInt<
    UInt<
        UInt<
            UInt<
                UInt<
                    UInt<
                        UInt<
                            UInt<
                                UInt<
                                    UInt<
                                        UInt<
                                            UInt<
                                                UInt<
                                                    UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>,
                                                    B1,
                                                >,
                                                B0,
                                            >,
                                            B0,
                                        >,
                                        B0,
                                    >,
                                    B1,
                                >,
                                B1,
                            >,
                            B0,
                        >,
                        B0,
                    >,
                    B0,
                >,
                B0,
            >,
            B0,
        >,
        B0,
    >,
    B0,
>;
/// Seconds in a Day
pub type P86400 = PInt<U86400>;

// 31_536_000 = 60 * 60 * 24 * 365 = 1111000010011001110000000
/// Seconds in a Year
pub type U31536000 = UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>, B0>, B0>, B0>, B0>, B1>, B0>, B0>, B1>, B1>, B0>, B0>, B1>, B1>, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>;
/// Seconds in a Year
pub type P31536000 = PInt<U31536000>;