re_types/blueprint/components/
component_column_selector.rs1#![allow(unused_imports)]
5#![allow(unused_parens)]
6#![allow(clippy::clone_on_copy)]
7#![allow(clippy::cloned_instead_of_copied)]
8#![allow(clippy::map_flatten)]
9#![allow(clippy::needless_question_mark)]
10#![allow(clippy::new_without_default)]
11#![allow(clippy::redundant_closure)]
12#![allow(clippy::too_many_arguments)]
13#![allow(clippy::too_many_lines)]
14
15use ::re_types_core::try_serialize_field;
16use ::re_types_core::SerializationResult;
17use ::re_types_core::{ComponentBatch as _, SerializedComponentBatch};
18use ::re_types_core::{ComponentDescriptor, ComponentName};
19use ::re_types_core::{DeserializationError, DeserializationResult};
20
21#[derive(Clone, Debug, Default, PartialEq, Eq, Hash)]
25#[repr(transparent)]
26pub struct ComponentColumnSelector(pub crate::blueprint::datatypes::ComponentColumnSelector);
27
28impl ::re_types_core::Component for ComponentColumnSelector {
29 #[inline]
30 fn descriptor() -> ComponentDescriptor {
31 ComponentDescriptor::new("rerun.blueprint.components.ComponentColumnSelector")
32 }
33}
34
35::re_types_core::macros::impl_into_cow!(ComponentColumnSelector);
36
37impl ::re_types_core::Loggable for ComponentColumnSelector {
38 #[inline]
39 fn arrow_datatype() -> arrow::datatypes::DataType {
40 crate::blueprint::datatypes::ComponentColumnSelector::arrow_datatype()
41 }
42
43 fn to_arrow_opt<'a>(
44 data: impl IntoIterator<Item = Option<impl Into<::std::borrow::Cow<'a, Self>>>>,
45 ) -> SerializationResult<arrow::array::ArrayRef>
46 where
47 Self: Clone + 'a,
48 {
49 crate::blueprint::datatypes::ComponentColumnSelector::to_arrow_opt(data.into_iter().map(
50 |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
59 fn from_arrow_opt(
60 arrow_data: &dyn arrow::array::Array,
61 ) -> DeserializationResult<Vec<Option<Self>>>
62 where
63 Self: Sized,
64 {
65 crate::blueprint::datatypes::ComponentColumnSelector::from_arrow_opt(arrow_data)
66 .map(|v| v.into_iter().map(|v| v.map(Self)).collect())
67 }
68}
69
70impl<T: Into<crate::blueprint::datatypes::ComponentColumnSelector>> From<T>
71 for ComponentColumnSelector
72{
73 fn from(v: T) -> Self {
74 Self(v.into())
75 }
76}
77
78impl std::borrow::Borrow<crate::blueprint::datatypes::ComponentColumnSelector>
79 for ComponentColumnSelector
80{
81 #[inline]
82 fn borrow(&self) -> &crate::blueprint::datatypes::ComponentColumnSelector {
83 &self.0
84 }
85}
86
87impl std::ops::Deref for ComponentColumnSelector {
88 type Target = crate::blueprint::datatypes::ComponentColumnSelector;
89
90 #[inline]
91 fn deref(&self) -> &crate::blueprint::datatypes::ComponentColumnSelector {
92 &self.0
93 }
94}
95
96impl std::ops::DerefMut for ComponentColumnSelector {
97 #[inline]
98 fn deref_mut(&mut self) -> &mut crate::blueprint::datatypes::ComponentColumnSelector {
99 &mut self.0
100 }
101}
102
103impl ::re_byte_size::SizeBytes for ComponentColumnSelector {
104 #[inline]
105 fn heap_size_bytes(&self) -> u64 {
106 self.0.heap_size_bytes()
107 }
108
109 #[inline]
110 fn is_pod() -> bool {
111 <crate::blueprint::datatypes::ComponentColumnSelector>::is_pod()
112 }
113}