nominal_api/conjure/objects/scout/compute/api/
frequency_bucket.rs1#[derive(
3 Debug,
4 Clone,
5 conjure_object::serde::Serialize,
6 conjure_object::serde::Deserialize,
7 conjure_object::private::DeriveWith
8)]
9#[serde(crate = "conjure_object::serde")]
10#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
11#[conjure_object::private::staged_builder::staged_builder]
12#[builder(crate = conjure_object::private::staged_builder, update, inline)]
13pub struct FrequencyBucket {
14 #[serde(rename = "frequencyStart")]
15 #[derive_with(with = conjure_object::private::DoubleWrapper)]
16 frequency_start: f64,
17 #[serde(rename = "frequencyEnd")]
18 #[derive_with(with = conjure_object::private::DoubleWrapper)]
19 frequency_end: f64,
20 #[serde(rename = "frequencyCenter")]
21 #[derive_with(with = conjure_object::private::DoubleWrapper)]
22 frequency_center: f64,
23 #[serde(rename = "minAmplitude")]
24 #[derive_with(with = conjure_object::private::DoubleWrapper)]
25 min_amplitude: f64,
26 #[serde(rename = "maxAmplitude")]
27 #[derive_with(with = conjure_object::private::DoubleWrapper)]
28 max_amplitude: f64,
29 #[serde(rename = "meanAmplitude")]
30 #[derive_with(with = conjure_object::private::DoubleWrapper)]
31 mean_amplitude: f64,
32 #[serde(rename = "count")]
33 count: conjure_object::SafeLong,
34 #[builder(custom(type = super::FrequencyPoint, convert = Box::new))]
35 #[serde(rename = "firstPoint")]
36 first_point: Box<super::FrequencyPoint>,
37 #[builder(
38 default,
39 custom(
40 type = impl
41 Into<Option<super::FrequencyPoint>>,
42 convert = |v|v.into().map(Box::new)
43 )
44 )]
45 #[serde(rename = "lastPoint", skip_serializing_if = "Option::is_none", default)]
46 last_point: Option<Box<super::FrequencyPoint>>,
47}
48impl FrequencyBucket {
49 #[inline]
51 pub fn frequency_start(&self) -> f64 {
52 self.frequency_start
53 }
54 #[inline]
56 pub fn frequency_end(&self) -> f64 {
57 self.frequency_end
58 }
59 #[inline]
61 pub fn frequency_center(&self) -> f64 {
62 self.frequency_center
63 }
64 #[inline]
66 pub fn min_amplitude(&self) -> f64 {
67 self.min_amplitude
68 }
69 #[inline]
71 pub fn max_amplitude(&self) -> f64 {
72 self.max_amplitude
73 }
74 #[inline]
76 pub fn mean_amplitude(&self) -> f64 {
77 self.mean_amplitude
78 }
79 #[inline]
81 pub fn count(&self) -> conjure_object::SafeLong {
82 self.count
83 }
84 #[inline]
86 pub fn first_point(&self) -> &super::FrequencyPoint {
87 &*self.first_point
88 }
89 #[inline]
91 pub fn last_point(&self) -> Option<&super::FrequencyPoint> {
92 self.last_point.as_ref().map(|o| &**o)
93 }
94}