nominal_api/conjure/objects/persistent/compute/api/
milliseconds.rs1#[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)]
14#[serde(crate = "conjure_object::serde", transparent)]
15pub struct Milliseconds(pub conjure_object::SafeLong);
16impl std::fmt::Display for Milliseconds {
17 fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
18 std::fmt::Display::fmt(&self.0, fmt)
19 }
20}
21impl conjure_object::Plain for Milliseconds {
22 fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
23 conjure_object::Plain::fmt(&self.0, fmt)
24 }
25}
26impl conjure_object::FromPlain for Milliseconds {
27 type Err = <conjure_object::SafeLong as conjure_object::FromPlain>::Err;
28 #[inline]
29 fn from_plain(s: &str) -> Result<Milliseconds, Self::Err> {
30 conjure_object::FromPlain::from_plain(s).map(Milliseconds)
31 }
32}
33impl std::convert::From<conjure_object::SafeLong> for Milliseconds {
34 #[inline]
35 fn from(v: conjure_object::SafeLong) -> Self {
36 Milliseconds(std::convert::From::from(v))
37 }
38}
39impl std::ops::Deref for Milliseconds {
40 type Target = conjure_object::SafeLong;
41 #[inline]
42 fn deref(&self) -> &conjure_object::SafeLong {
43 &self.0
44 }
45}
46impl std::ops::DerefMut for Milliseconds {
47 #[inline]
48 fn deref_mut(&mut self) -> &mut conjure_object::SafeLong {
49 &mut self.0
50 }
51}
52impl std::convert::AsRef<conjure_object::SafeLong> for Milliseconds {
53 #[inline]
54 fn as_ref(&self) -> &conjure_object::SafeLong {
55 &self.0
56 }
57}