re_types/components/
transform_mat3x3.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, Copy, PartialEq, bytemuck::Pod, bytemuck::Zeroable)]
35#[repr(transparent)]
36pub struct TransformMat3x3(pub crate::datatypes::Mat3x3);
37
38impl ::re_types_core::Component for TransformMat3x3 {
39 #[inline]
40 fn descriptor() -> ComponentDescriptor {
41 ComponentDescriptor::new("rerun.components.TransformMat3x3")
42 }
43}
44
45::re_types_core::macros::impl_into_cow!(TransformMat3x3);
46
47impl ::re_types_core::Loggable for TransformMat3x3 {
48 #[inline]
49 fn arrow_datatype() -> arrow::datatypes::DataType {
50 crate::datatypes::Mat3x3::arrow_datatype()
51 }
52
53 fn to_arrow_opt<'a>(
54 data: impl IntoIterator<Item = Option<impl Into<::std::borrow::Cow<'a, Self>>>>,
55 ) -> SerializationResult<arrow::array::ArrayRef>
56 where
57 Self: Clone + 'a,
58 {
59 crate::datatypes::Mat3x3::to_arrow_opt(data.into_iter().map(|datum| {
60 datum.map(|datum| match datum.into() {
61 ::std::borrow::Cow::Borrowed(datum) => ::std::borrow::Cow::Borrowed(&datum.0),
62 ::std::borrow::Cow::Owned(datum) => ::std::borrow::Cow::Owned(datum.0),
63 })
64 }))
65 }
66
67 fn from_arrow_opt(
68 arrow_data: &dyn arrow::array::Array,
69 ) -> DeserializationResult<Vec<Option<Self>>>
70 where
71 Self: Sized,
72 {
73 crate::datatypes::Mat3x3::from_arrow_opt(arrow_data)
74 .map(|v| v.into_iter().map(|v| v.map(Self)).collect())
75 }
76
77 #[inline]
78 fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult<Vec<Self>>
79 where
80 Self: Sized,
81 {
82 crate::datatypes::Mat3x3::from_arrow(arrow_data).map(bytemuck::cast_vec)
83 }
84}
85
86impl<T: Into<crate::datatypes::Mat3x3>> From<T> for TransformMat3x3 {
87 fn from(v: T) -> Self {
88 Self(v.into())
89 }
90}
91
92impl std::borrow::Borrow<crate::datatypes::Mat3x3> for TransformMat3x3 {
93 #[inline]
94 fn borrow(&self) -> &crate::datatypes::Mat3x3 {
95 &self.0
96 }
97}
98
99impl std::ops::Deref for TransformMat3x3 {
100 type Target = crate::datatypes::Mat3x3;
101
102 #[inline]
103 fn deref(&self) -> &crate::datatypes::Mat3x3 {
104 &self.0
105 }
106}
107
108impl std::ops::DerefMut for TransformMat3x3 {
109 #[inline]
110 fn deref_mut(&mut self) -> &mut crate::datatypes::Mat3x3 {
111 &mut self.0
112 }
113}
114
115impl ::re_byte_size::SizeBytes for TransformMat3x3 {
116 #[inline]
117 fn heap_size_bytes(&self) -> u64 {
118 self.0.heap_size_bytes()
119 }
120
121 #[inline]
122 fn is_pod() -> bool {
123 <crate::datatypes::Mat3x3>::is_pod()
124 }
125}