[go: up one dir, main page]

time 0.2.20

Date and time library. Fully interoperable with the standard library. Mostly compatible with #![no_std].
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// (seconds, nanoseconds)
#[derive(serde::Serialize, serde::Deserialize)]
pub(crate) struct Duration(i64, i32);

impl From<crate::Duration> for Duration {
    fn from(original: crate::Duration) -> Self {
        Self(original.whole_seconds(), original.subsec_nanoseconds())
    }
}

impl From<Duration> for crate::Duration {
    fn from(original: Duration) -> Self {
        Self::new(original.0, original.1)
    }
}