re_types/blueprint/components/
filter_by_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/filter_by_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**: Configuration for a filter-by-range feature of the dataframe view.
23///
24/// ⚠️ **This type is _unstable_ and may change significantly in a way that the data won't be backwards compatible.**
25#[derive(Clone, Debug, PartialEq, Eq)]
26#[repr(transparent)]
27pub struct FilterByRange(pub crate::blueprint::datatypes::FilterByRange);
28
29impl ::re_types_core::Component for FilterByRange {
30    #[inline]
31    fn name() -> ComponentType {
32        "rerun.blueprint.components.FilterByRange".into()
33    }
34}
35
36::re_types_core::macros::impl_into_cow!(FilterByRange);
37
38impl ::re_types_core::Loggable for FilterByRange {
39    #[inline]
40    fn arrow_datatype() -> arrow::datatypes::DataType {
41        crate::blueprint::datatypes::FilterByRange::arrow_datatype()
42    }
43
44    fn to_arrow_opt<'a>(
45        data: impl IntoIterator<Item = Option<impl Into<::std::borrow::Cow<'a, Self>>>>,
46    ) -> SerializationResult<arrow::array::ArrayRef>
47    where
48        Self: Clone + 'a,
49    {
50        crate::blueprint::datatypes::FilterByRange::to_arrow_opt(data.into_iter().map(|datum| {
51            datum.map(|datum| match datum.into() {
52                ::std::borrow::Cow::Borrowed(datum) => ::std::borrow::Cow::Borrowed(&datum.0),
53                ::std::borrow::Cow::Owned(datum) => ::std::borrow::Cow::Owned(datum.0),
54            })
55        }))
56    }
57
58    fn from_arrow_opt(
59        arrow_data: &dyn arrow::array::Array,
60    ) -> DeserializationResult<Vec<Option<Self>>>
61    where
62        Self: Sized,
63    {
64        crate::blueprint::datatypes::FilterByRange::from_arrow_opt(arrow_data)
65            .map(|v| v.into_iter().map(|v| v.map(Self)).collect())
66    }
67}
68
69impl<T: Into<crate::blueprint::datatypes::FilterByRange>> From<T> for FilterByRange {
70    fn from(v: T) -> Self {
71        Self(v.into())
72    }
73}
74
75impl std::borrow::Borrow<crate::blueprint::datatypes::FilterByRange> for FilterByRange {
76    #[inline]
77    fn borrow(&self) -> &crate::blueprint::datatypes::FilterByRange {
78        &self.0
79    }
80}
81
82impl std::ops::Deref for FilterByRange {
83    type Target = crate::blueprint::datatypes::FilterByRange;
84
85    #[inline]
86    fn deref(&self) -> &crate::blueprint::datatypes::FilterByRange {
87        &self.0
88    }
89}
90
91impl std::ops::DerefMut for FilterByRange {
92    #[inline]
93    fn deref_mut(&mut self) -> &mut crate::blueprint::datatypes::FilterByRange {
94        &mut self.0
95    }
96}
97
98impl ::re_byte_size::SizeBytes for FilterByRange {
99    #[inline]
100    fn heap_size_bytes(&self) -> u64 {
101        self.0.heap_size_bytes()
102    }
103
104    #[inline]
105    fn is_pod() -> bool {
106        <crate::blueprint::datatypes::FilterByRange>::is_pod()
107    }
108}