Skip to main content

nominal_api_conjure/conjure/objects/persistent/compute/api/
milliseconds.rs

1#[derive(
2    Debug,
3    Clone,
4    conjure_object::serde::Deserialize,
5    conjure_object::serde::Serialize,
6    Copy,
7    PartialEq,
8    Eq,
9    PartialOrd,
10    Ord,
11    Hash,
12    Default,
13    conjure_object::log_safety::derive::LogSafe
14)]
15#[serde(crate = "conjure_object::serde", transparent)]
16pub struct Milliseconds(#[assert_is_safe] pub conjure_object::SafeLong);
17impl std::fmt::Display for Milliseconds {
18    fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
19        std::fmt::Display::fmt(&self.0, fmt)
20    }
21}
22impl conjure_object::Plain for Milliseconds {
23    fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
24        conjure_object::Plain::fmt(&self.0, fmt)
25    }
26}
27impl conjure_object::FromPlain for Milliseconds {
28    type Err = <conjure_object::SafeLong as conjure_object::FromPlain>::Err;
29    #[inline]
30    fn from_plain(s: &str) -> Result<Milliseconds, Self::Err> {
31        conjure_object::FromPlain::from_plain(s).map(Milliseconds)
32    }
33}
34impl std::convert::From<conjure_object::SafeLong> for Milliseconds {
35    #[inline]
36    fn from(v: conjure_object::SafeLong) -> Self {
37        Milliseconds(std::convert::From::from(v))
38    }
39}
40impl std::ops::Deref for Milliseconds {
41    type Target = conjure_object::SafeLong;
42    #[inline]
43    fn deref(&self) -> &conjure_object::SafeLong {
44        &self.0
45    }
46}
47impl std::ops::DerefMut for Milliseconds {
48    #[inline]
49    fn deref_mut(&mut self) -> &mut conjure_object::SafeLong {
50        &mut self.0
51    }
52}
53impl std::convert::AsRef<conjure_object::SafeLong> for Milliseconds {
54    #[inline]
55    fn as_ref(&self) -> &conjure_object::SafeLong {
56        &self.0
57    }
58}