re_types/blueprint/components/
visible_time_range.rs

1// DO NOT EDIT! This file was auto-generated by crates/build/re_types_builder/src/codegen/rust/api.rs
2// Based on "crates/store/re_types/definitions/rerun/blueprint/components/visible_time_range.fbs".
3
4#![allow(unused_braces)]
5#![allow(unused_imports)]
6#![allow(unused_parens)]
7#![allow(clippy::clone_on_copy)]
8#![allow(clippy::cloned_instead_of_copied)]
9#![allow(clippy::map_flatten)]
10#![allow(clippy::needless_question_mark)]
11#![allow(clippy::new_without_default)]
12#![allow(clippy::redundant_closure)]
13#![allow(clippy::too_many_arguments)]
14#![allow(clippy::too_many_lines)]
15
16use ::re_types_core::try_serialize_field;
17use ::re_types_core::SerializationResult;
18use ::re_types_core::{ComponentBatch as _, SerializedComponentBatch};
19use ::re_types_core::{ComponentDescriptor, ComponentType};
20use ::re_types_core::{DeserializationError, DeserializationResult};
21
22/// **Component**: The range of values on a given timeline that will be included in a view's query.
23///
24/// Refer to `VisibleTimeRanges` archetype for more information.
25///
26/// ⚠️ **This type is _unstable_ and may change significantly in a way that the data won't be backwards compatible.**
27#[derive(Clone, Debug, Default, PartialEq, Eq)]
28#[repr(transparent)]
29pub struct VisibleTimeRange(pub crate::datatypes::VisibleTimeRange);
30
31impl ::re_types_core::Component for VisibleTimeRange {
32    #[inline]
33    fn name() -> ComponentType {
34        "rerun.blueprint.components.VisibleTimeRange".into()
35    }
36}
37
38::re_types_core::macros::impl_into_cow!(VisibleTimeRange);
39
40impl ::re_types_core::Loggable for VisibleTimeRange {
41    #[inline]
42    fn arrow_datatype() -> arrow::datatypes::DataType {
43        crate::datatypes::VisibleTimeRange::arrow_datatype()
44    }
45
46    fn to_arrow_opt<'a>(
47        data: impl IntoIterator<Item = Option<impl Into<::std::borrow::Cow<'a, Self>>>>,
48    ) -> SerializationResult<arrow::array::ArrayRef>
49    where
50        Self: Clone + 'a,
51    {
52        crate::datatypes::VisibleTimeRange::to_arrow_opt(data.into_iter().map(|datum| {
53            datum.map(|datum| match datum.into() {
54                ::std::borrow::Cow::Borrowed(datum) => ::std::borrow::Cow::Borrowed(&datum.0),
55                ::std::borrow::Cow::Owned(datum) => ::std::borrow::Cow::Owned(datum.0),
56            })
57        }))
58    }
59
60    fn from_arrow_opt(
61        arrow_data: &dyn arrow::array::Array,
62    ) -> DeserializationResult<Vec<Option<Self>>>
63    where
64        Self: Sized,
65    {
66        crate::datatypes::VisibleTimeRange::from_arrow_opt(arrow_data)
67            .map(|v| v.into_iter().map(|v| v.map(Self)).collect())
68    }
69}
70
71impl<T: Into<crate::datatypes::VisibleTimeRange>> From<T> for VisibleTimeRange {
72    fn from(v: T) -> Self {
73        Self(v.into())
74    }
75}
76
77impl std::borrow::Borrow<crate::datatypes::VisibleTimeRange> for VisibleTimeRange {
78    #[inline]
79    fn borrow(&self) -> &crate::datatypes::VisibleTimeRange {
80        &self.0
81    }
82}
83
84impl std::ops::Deref for VisibleTimeRange {
85    type Target = crate::datatypes::VisibleTimeRange;
86
87    #[inline]
88    fn deref(&self) -> &crate::datatypes::VisibleTimeRange {
89        &self.0
90    }
91}
92
93impl std::ops::DerefMut for VisibleTimeRange {
94    #[inline]
95    fn deref_mut(&mut self) -> &mut crate::datatypes::VisibleTimeRange {
96        &mut self.0
97    }
98}
99
100impl ::re_byte_size::SizeBytes for VisibleTimeRange {
101    #[inline]
102    fn heap_size_bytes(&self) -> u64 {
103        self.0.heap_size_bytes()
104    }
105
106    #[inline]
107    fn is_pod() -> bool {
108        <crate::datatypes::VisibleTimeRange>::is_pod()
109    }
110}