typus_fugit 0.1.3

`typenum` powered time library for the embedded ecosystem.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use core::marker::PhantomData;

use typenum::NonZero;

/// Period in seconds represented as a ratio.
///
/// ```rust
/// use typus_fugit::typenum::{U1, U60, U1000};
/// use typus_fugit::Period;
/// type Seconds = Period<U1, U1>;
/// type Minutes = Period<U60, U1>;
/// type Ms = Period<U1, U1000>;
/// ```
#[derive(Clone, Copy, Debug, Default)]
pub struct Period<Numer, Denom: NonZero> {
    pub(crate) _numer: PhantomData<Numer>,
    pub(crate) _denom: PhantomData<Denom>,
}