re_types/blueprint/components/
visual_bounds2d.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/visual_bounds2d.fbs".
3
4#![allow(unused_braces)]
5#![allow(unused_imports)]
6#![allow(unused_parens)]
7#![allow(clippy::allow_attributes)]
8#![allow(clippy::clone_on_copy)]
9#![allow(clippy::cloned_instead_of_copied)]
10#![allow(clippy::map_flatten)]
11#![allow(clippy::needless_question_mark)]
12#![allow(clippy::new_without_default)]
13#![allow(clippy::redundant_closure)]
14#![allow(clippy::too_many_arguments)]
15#![allow(clippy::too_many_lines)]
16#![allow(clippy::wildcard_imports)]
17
18use ::re_types_core::SerializationResult;
19use ::re_types_core::try_serialize_field;
20use ::re_types_core::{ComponentBatch as _, SerializedComponentBatch};
21use ::re_types_core::{ComponentDescriptor, ComponentType};
22use ::re_types_core::{DeserializationError, DeserializationResult};
23
24/// **Component**: Visual bounds in 2D space used for `Spatial2DView`.
25///
26/// ⚠️ **This type is _unstable_ and may change significantly in a way that the data won't be backwards compatible.**
27#[derive(Clone, Debug, Copy, PartialEq, bytemuck::Pod, bytemuck::Zeroable)]
28#[repr(transparent)]
29pub struct VisualBounds2D(
30    /// X and y ranges that should be visible.
31    pub crate::datatypes::Range2D,
32);
33
34impl ::re_types_core::WrapperComponent for VisualBounds2D {
35    type Datatype = crate::datatypes::Range2D;
36
37    #[inline]
38    fn name() -> ComponentType {
39        "rerun.blueprint.components.VisualBounds2D".into()
40    }
41
42    #[inline]
43    fn into_inner(self) -> Self::Datatype {
44        self.0
45    }
46}
47
48::re_types_core::macros::impl_into_cow!(VisualBounds2D);
49
50impl<T: Into<crate::datatypes::Range2D>> From<T> for VisualBounds2D {
51    fn from(v: T) -> Self {
52        Self(v.into())
53    }
54}
55
56impl std::borrow::Borrow<crate::datatypes::Range2D> for VisualBounds2D {
57    #[inline]
58    fn borrow(&self) -> &crate::datatypes::Range2D {
59        &self.0
60    }
61}
62
63impl std::ops::Deref for VisualBounds2D {
64    type Target = crate::datatypes::Range2D;
65
66    #[inline]
67    fn deref(&self) -> &crate::datatypes::Range2D {
68        &self.0
69    }
70}
71
72impl std::ops::DerefMut for VisualBounds2D {
73    #[inline]
74    fn deref_mut(&mut self) -> &mut crate::datatypes::Range2D {
75        &mut self.0
76    }
77}
78
79impl ::re_byte_size::SizeBytes for VisualBounds2D {
80    #[inline]
81    fn heap_size_bytes(&self) -> u64 {
82        self.0.heap_size_bytes()
83    }
84
85    #[inline]
86    fn is_pod() -> bool {
87        <crate::datatypes::Range2D>::is_pod()
88    }
89}