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
#[derive(heim_derive::Unit, Copy, Clone, Debug, Default, PartialOrd, PartialEq)]
pub struct Time(f64);
impl Time {
#[doc(hidden)]
pub fn from_nanoseconds(value: f64) -> Self {
Self::new(value * 1_000_000_000.0)
}
#[doc(hidden)]
pub fn from_milliseconds(value: f64) -> Self {
Self::new(value * 1_000.0)
}
#[doc(hidden)]
pub fn from_microseconds(value: f64) -> Self {
Self::new(value * 1_000_000.0)
}
}
#[derive(heim_derive::Unit, Copy, Clone, Debug, Default, PartialOrd, Ord, PartialEq, Eq, Hash)]
pub struct Information(u64);
impl Information {
#[doc(hidden)]
pub fn from_kilobytes(value: u64) -> Self {
Self::new(value * 1_024)
}
}
#[derive(heim_derive::Unit, Copy, Clone, Debug, Default, PartialOrd, PartialEq)]
pub struct Ratio(f32);