re_types 0.27.3

The built-in Rerun data types, component types, and archetypes.
Documentation
// DO NOT EDIT! This file was auto-generated by crates/build/re_types_builder/src/codegen/rust/api.rs
// Based on "crates/store/re_types/definitions/rerun/components/resolution.fbs".

#![allow(unused_braces)]
#![allow(unused_imports)]
#![allow(unused_parens)]
#![allow(clippy::allow_attributes)]
#![allow(clippy::clone_on_copy)]
#![allow(clippy::cloned_instead_of_copied)]
#![allow(clippy::map_flatten)]
#![allow(clippy::needless_question_mark)]
#![allow(clippy::new_without_default)]
#![allow(clippy::redundant_closure)]
#![allow(clippy::too_many_arguments)]
#![allow(clippy::too_many_lines)]
#![allow(clippy::wildcard_imports)]

use ::re_types_core::SerializationResult;
use ::re_types_core::try_serialize_field;
use ::re_types_core::{ComponentBatch as _, SerializedComponentBatch};
use ::re_types_core::{ComponentDescriptor, ComponentType};
use ::re_types_core::{DeserializationError, DeserializationResult};

/// **Component**: Pixel resolution width & height, e.g. of a camera sensor.
///
/// Typically in integer units, but for some use cases floating point may be used.
#[derive(Clone, Debug, Copy, PartialEq)]
pub struct Resolution(pub crate::datatypes::Vec2D);

impl ::re_types_core::WrapperComponent for Resolution {
    type Datatype = crate::datatypes::Vec2D;

    #[inline]
    fn name() -> ComponentType {
        "rerun.components.Resolution".into()
    }

    #[inline]
    fn into_inner(self) -> Self::Datatype {
        self.0
    }
}

::re_types_core::macros::impl_into_cow!(Resolution);

impl<T: Into<crate::datatypes::Vec2D>> From<T> for Resolution {
    fn from(v: T) -> Self {
        Self(v.into())
    }
}

impl std::borrow::Borrow<crate::datatypes::Vec2D> for Resolution {
    #[inline]
    fn borrow(&self) -> &crate::datatypes::Vec2D {
        &self.0
    }
}

impl std::ops::Deref for Resolution {
    type Target = crate::datatypes::Vec2D;

    #[inline]
    fn deref(&self) -> &crate::datatypes::Vec2D {
        &self.0
    }
}

impl std::ops::DerefMut for Resolution {
    #[inline]
    fn deref_mut(&mut self) -> &mut crate::datatypes::Vec2D {
        &mut self.0
    }
}

impl ::re_byte_size::SizeBytes for Resolution {
    #[inline]
    fn heap_size_bytes(&self) -> u64 {
        self.0.heap_size_bytes()
    }

    #[inline]
    fn is_pod() -> bool {
        <crate::datatypes::Vec2D>::is_pod()
    }
}