re_types/components/
channel_id.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/components/channel_id.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**: A 16-bit ID representing an MCAP channel.
25///
26/// Used to identify specific channels within an MCAP file.
27#[derive(Clone, Debug, Copy, PartialEq, Eq, PartialOrd, Ord)]
28#[repr(transparent)]
29pub struct ChannelId(pub crate::datatypes::UInt16);
30
31impl ::re_types_core::WrapperComponent for ChannelId {
32    type Datatype = crate::datatypes::UInt16;
33
34    #[inline]
35    fn name() -> ComponentType {
36        "rerun.components.ChannelId".into()
37    }
38
39    #[inline]
40    fn into_inner(self) -> Self::Datatype {
41        self.0
42    }
43}
44
45::re_types_core::macros::impl_into_cow!(ChannelId);
46
47impl<T: Into<crate::datatypes::UInt16>> From<T> for ChannelId {
48    fn from(v: T) -> Self {
49        Self(v.into())
50    }
51}
52
53impl std::borrow::Borrow<crate::datatypes::UInt16> for ChannelId {
54    #[inline]
55    fn borrow(&self) -> &crate::datatypes::UInt16 {
56        &self.0
57    }
58}
59
60impl std::ops::Deref for ChannelId {
61    type Target = crate::datatypes::UInt16;
62
63    #[inline]
64    fn deref(&self) -> &crate::datatypes::UInt16 {
65        &self.0
66    }
67}
68
69impl std::ops::DerefMut for ChannelId {
70    #[inline]
71    fn deref_mut(&mut self) -> &mut crate::datatypes::UInt16 {
72        &mut self.0
73    }
74}
75
76impl ::re_byte_size::SizeBytes for ChannelId {
77    #[inline]
78    fn heap_size_bytes(&self) -> u64 {
79        self.0.heap_size_bytes()
80    }
81
82    #[inline]
83    fn is_pod() -> bool {
84        <crate::datatypes::UInt16>::is_pod()
85    }
86}