re_types_blueprint/blueprint/components/
space_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/space_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::external::arrow2;
16use ::re_types_core::ComponentName;
17use ::re_types_core::SerializationResult;
18use ::re_types_core::{ComponentBatch, MaybeOwnedComponentBatch};
19use ::re_types_core::{DeserializationError, DeserializationResult};
20
21/// **Component**: Whether a space view is maximized.
22#[derive(Clone, Debug, Default)]
23#[repr(transparent)]
24pub struct SpaceViewMaximized(pub crate::datatypes::Uuid);
25
26impl ::re_types_core::SizeBytes for SpaceViewMaximized {
27    #[inline]
28    fn heap_size_bytes(&self) -> u64 {
29        self.0.heap_size_bytes()
30    }
31
32    #[inline]
33    fn is_pod() -> bool {
34        <crate::datatypes::Uuid>::is_pod()
35    }
36}
37
38impl<T: Into<crate::datatypes::Uuid>> From<T> for SpaceViewMaximized {
39    fn from(v: T) -> Self {
40        Self(v.into())
41    }
42}
43
44impl std::borrow::Borrow<crate::datatypes::Uuid> for SpaceViewMaximized {
45    #[inline]
46    fn borrow(&self) -> &crate::datatypes::Uuid {
47        &self.0
48    }
49}
50
51impl std::ops::Deref for SpaceViewMaximized {
52    type Target = crate::datatypes::Uuid;
53
54    #[inline]
55    fn deref(&self) -> &crate::datatypes::Uuid {
56        &self.0
57    }
58}
59
60impl std::ops::DerefMut for SpaceViewMaximized {
61    #[inline]
62    fn deref_mut(&mut self) -> &mut crate::datatypes::Uuid {
63        &mut self.0
64    }
65}
66
67::re_types_core::macros::impl_into_cow!(SpaceViewMaximized);
68
69impl ::re_types_core::Loggable for SpaceViewMaximized {
70    type Name = ::re_types_core::ComponentName;
71
72    #[inline]
73    fn name() -> Self::Name {
74        "rerun.blueprint.components.SpaceViewMaximized".into()
75    }
76
77    #[inline]
78    fn arrow_datatype() -> arrow2::datatypes::DataType {
79        crate::datatypes::Uuid::arrow_datatype()
80    }
81
82    fn to_arrow_opt<'a>(
83        data: impl IntoIterator<Item = Option<impl Into<::std::borrow::Cow<'a, Self>>>>,
84    ) -> SerializationResult<Box<dyn arrow2::array::Array>>
85    where
86        Self: Clone + 'a,
87    {
88        crate::datatypes::Uuid::to_arrow_opt(data.into_iter().map(|datum| {
89            datum.map(|datum| match datum.into() {
90                ::std::borrow::Cow::Borrowed(datum) => ::std::borrow::Cow::Borrowed(&datum.0),
91                ::std::borrow::Cow::Owned(datum) => ::std::borrow::Cow::Owned(datum.0),
92            })
93        }))
94    }
95
96    fn from_arrow_opt(
97        arrow_data: &dyn arrow2::array::Array,
98    ) -> DeserializationResult<Vec<Option<Self>>>
99    where
100        Self: Sized,
101    {
102        crate::datatypes::Uuid::from_arrow_opt(arrow_data)
103            .map(|v| v.into_iter().map(|v| v.map(Self)).collect())
104    }
105
106    #[inline]
107    fn from_arrow(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult<Vec<Self>>
108    where
109        Self: Sized,
110    {
111        crate::datatypes::Uuid::from_arrow(arrow_data).map(|v| v.into_iter().map(Self).collect())
112    }
113}