Skip to main content

nominal_api/conjure/objects/scout/comparisonrun/api/
offset.rs

1#[derive(
2    Debug,
3    Clone,
4    conjure_object::serde::Serialize,
5    conjure_object::serde::Deserialize,
6    PartialEq,
7    Eq,
8    PartialOrd,
9    Ord,
10    Hash
11)]
12#[serde(crate = "conjure_object::serde")]
13#[conjure_object::private::staged_builder::staged_builder]
14#[builder(crate = conjure_object::private::staged_builder, update, inline)]
15pub struct Offset {
16    #[serde(rename = "value")]
17    value: conjure_object::SafeLong,
18    #[serde(rename = "unit")]
19    unit: super::super::super::super::api::TimeUnit,
20}
21impl Offset {
22    /// Constructs a new instance of the type.
23    #[inline]
24    pub fn new(
25        value: conjure_object::SafeLong,
26        unit: super::super::super::super::api::TimeUnit,
27    ) -> Self {
28        Self::builder().value(value).unit(unit).build()
29    }
30    #[inline]
31    pub fn value(&self) -> conjure_object::SafeLong {
32        self.value
33    }
34    #[inline]
35    pub fn unit(&self) -> &super::super::super::super::api::TimeUnit {
36        &self.unit
37    }
38}