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