Skip to main content

nominal_api/conjure/objects/scout/video/api/
timestamp_mappings.rs

1/// contains 2 equal-length lists, which contain the video media time and user-provided absolute time
2/// for the frame at each index. Enables frame-mapping on the front-end.
3#[derive(
4    Debug,
5    Clone,
6    conjure_object::serde::Serialize,
7    conjure_object::serde::Deserialize,
8    conjure_object::private::DeriveWith
9)]
10#[serde(crate = "conjure_object::serde")]
11#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
12#[conjure_object::private::staged_builder::staged_builder]
13#[builder(crate = conjure_object::private::staged_builder, update, inline)]
14pub struct TimestampMappings {
15    #[builder(default, list(item(type = f64)))]
16    #[serde(rename = "mediaTimestamps", skip_serializing_if = "Vec::is_empty", default)]
17    #[derive_with(with = conjure_object::private::DoubleWrapper)]
18    media_timestamps: Vec<f64>,
19    #[builder(default, list(item(type = super::super::super::super::api::Timestamp)))]
20    #[serde(
21        rename = "absoluteTimestamps",
22        skip_serializing_if = "Vec::is_empty",
23        default
24    )]
25    absolute_timestamps: Vec<super::super::super::super::api::Timestamp>,
26}
27impl TimestampMappings {
28    /// Constructs a new instance of the type.
29    #[inline]
30    pub fn new() -> Self {
31        Self::builder().build()
32    }
33    #[inline]
34    pub fn media_timestamps(&self) -> &[f64] {
35        &*self.media_timestamps
36    }
37    #[inline]
38    pub fn absolute_timestamps(&self) -> &[super::super::super::super::api::Timestamp] {
39        &*self.absolute_timestamps
40    }
41}