Skip to main content

nominal_api/conjure/objects/scout/chartdefinition/api/
staleness_configuration.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 StalenessConfiguration {
16    #[builder(
17        custom(type = super::super::super::run::api::Duration, convert = Box::new)
18    )]
19    #[serde(rename = "threshold")]
20    threshold: Box<super::super::super::run::api::Duration>,
21    #[serde(rename = "connectStalePoints")]
22    connect_stale_points: bool,
23}
24impl StalenessConfiguration {
25    /// Constructs a new instance of the type.
26    #[inline]
27    pub fn new(
28        threshold: super::super::super::run::api::Duration,
29        connect_stale_points: bool,
30    ) -> Self {
31        Self::builder()
32            .threshold(threshold)
33            .connect_stale_points(connect_stale_points)
34            .build()
35    }
36    /// The duration above which points are considered stale. By default this is 1 second.
37    #[inline]
38    pub fn threshold(&self) -> &super::super::super::run::api::Duration {
39        &*self.threshold
40    }
41    /// Whether or not to visually connect stale points, i.e. points whose distance exceeds that of the configured threshold. By default this is true.
42    #[inline]
43    pub fn connect_stale_points(&self) -> bool {
44        self.connect_stale_points
45    }
46}