Skip to main content

nominal_api_conjure/conjure/objects/api/
range.rs

1/// Deprecated for new APIs. Define an API-owned range with the endpoint semantics it needs instead.
2#[derive(
3    Debug,
4    Clone,
5    conjure_object::serde::Serialize,
6    conjure_object::serde::Deserialize,
7    PartialEq,
8    Eq,
9    PartialOrd,
10    Ord,
11    Hash,
12    conjure_object::log_safety::derive::LogSafe
13)]
14#[serde(crate = "conjure_object::serde")]
15#[conjure_object::private::staged_builder::staged_builder]
16#[builder(crate = conjure_object::private::staged_builder, update, inline)]
17pub struct Range {
18    #[builder(custom(type = super::Timestamp, convert = Box::new))]
19    #[serde(rename = "start")]
20    start: Box<super::Timestamp>,
21    #[builder(custom(type = super::Timestamp, convert = Box::new))]
22    #[serde(rename = "end")]
23    end: Box<super::Timestamp>,
24}
25impl Range {
26    /// Constructs a new instance of the type.
27    #[inline]
28    pub fn new(start: super::Timestamp, end: super::Timestamp) -> Self {
29        Self::builder().start(start).end(end).build()
30    }
31    #[inline]
32    pub fn start(&self) -> &super::Timestamp {
33        &*self.start
34    }
35    #[inline]
36    pub fn end(&self) -> &super::Timestamp {
37        &*self.end
38    }
39}