Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Datatype & Component both inherit from Loggable #2677

Merged
merged 3 commits into from
Jul 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/re_types/source_hash.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This is a sha256 hash for all direct and indirect dependencies of this crate's build script.
# It can be safely removed at anytime to force the build script to run again.
# Check out build.rs to see how it's computed.
73588bbdd10b7303d8d04bda573c315fd2acb3cd3edd2ee5244a926064c8dc46
d86ab89fae71ae9a5f145017617c8bdb8f1f65355e5788eff6b2c88ee3a9081b
4 changes: 2 additions & 2 deletions crates/re_types/src/archetypes/fuzzy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ impl crate::Archetype for AffixFuzzer1 {
) -> crate::SerializationResult<
Vec<(::arrow2::datatypes::Field, Box<dyn ::arrow2::array::Array>)>,
> {
use crate::Component as _;
use crate::Loggable as _;
Ok([
{
Some({
Expand Down Expand Up @@ -1592,7 +1592,7 @@ impl crate::Archetype for AffixFuzzer1 {
fn try_from_arrow(
data: impl IntoIterator<Item = (::arrow2::datatypes::Field, Box<dyn ::arrow2::array::Array>)>,
) -> crate::DeserializationResult<Self> {
use crate::Component as _;
use crate::Loggable as _;
let arrays_by_name: ::std::collections::HashMap<_, _> = data
.into_iter()
.map(|(field, array)| (field.name, array))
Expand Down
4 changes: 2 additions & 2 deletions crates/re_types/src/archetypes/points2d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ impl crate::Archetype for Points2D {
) -> crate::SerializationResult<
Vec<(::arrow2::datatypes::Field, Box<dyn ::arrow2::array::Array>)>,
> {
use crate::Component as _;
use crate::Loggable as _;
Ok([
{
Some({
Expand Down Expand Up @@ -301,7 +301,7 @@ impl crate::Archetype for Points2D {
fn try_from_arrow(
data: impl IntoIterator<Item = (::arrow2::datatypes::Field, Box<dyn ::arrow2::array::Array>)>,
) -> crate::DeserializationResult<Self> {
use crate::Component as _;
use crate::Loggable as _;
let arrays_by_name: ::std::collections::HashMap<_, _> = data
.into_iter()
.map(|(field, array)| (field.name, array))
Expand Down
4 changes: 2 additions & 2 deletions crates/re_types/src/archetypes/transform3d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl crate::Archetype for Transform3D {
) -> crate::SerializationResult<
Vec<(::arrow2::datatypes::Field, Box<dyn ::arrow2::array::Array>)>,
> {
use crate::Component as _;
use crate::Loggable as _;
Ok([{
Some({
let array = <crate::components::Transform3D>::try_to_arrow([&self.transform], None);
Expand All @@ -88,7 +88,7 @@ impl crate::Archetype for Transform3D {
fn try_from_arrow(
data: impl IntoIterator<Item = (::arrow2::datatypes::Field, Box<dyn ::arrow2::array::Array>)>,
) -> crate::DeserializationResult<Self> {
use crate::Component as _;
use crate::Loggable as _;
let arrays_by_name: ::std::collections::HashMap<_, _> = data
.into_iter()
.map(|(field, array)| (field.name, array))
Expand Down
11 changes: 7 additions & 4 deletions crates/re_types/src/components/class_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ impl<'a> From<&'a ClassId> for ::std::borrow::Cow<'a, ClassId> {
}
}

impl crate::Component for ClassId {
impl crate::Loggable for ClassId {
type Name = crate::ComponentName;
#[inline]
fn name() -> crate::ComponentName {
fn name() -> Self::Name {
crate::ComponentName::Borrowed("rerun.class_id")
}

Expand All @@ -53,7 +54,7 @@ impl crate::Component for ClassId {
where
Self: Clone + 'a,
{
use crate::{Component as _, Datatype as _};
use crate::Loggable as _;
use ::arrow2::{array::*, datatypes::*};
Ok({
let (somes, data0): (Vec<_>, Vec<_>) = data
Expand Down Expand Up @@ -96,7 +97,7 @@ impl crate::Component for ClassId {
where
Self: Sized,
{
use crate::{Component as _, Datatype as _};
use crate::Loggable as _;
use ::arrow2::{array::*, datatypes::*};
Ok(data
.as_any()
Expand All @@ -113,3 +114,5 @@ impl crate::Component for ClassId {
.collect::<crate::DeserializationResult<Vec<Option<_>>>>()?)
}
}

impl crate::Component for ClassId {}
11 changes: 7 additions & 4 deletions crates/re_types/src/components/color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ impl<'a> From<&'a Color> for ::std::borrow::Cow<'a, Color> {
}
}

impl crate::Component for Color {
impl crate::Loggable for Color {
type Name = crate::ComponentName;
#[inline]
fn name() -> crate::ComponentName {
fn name() -> Self::Name {
crate::ComponentName::Borrowed("rerun.colorrgba")
}

Expand All @@ -63,7 +64,7 @@ impl crate::Component for Color {
where
Self: Clone + 'a,
{
use crate::{Component as _, Datatype as _};
use crate::Loggable as _;
use ::arrow2::{array::*, datatypes::*};
Ok({
let (somes, data0): (Vec<_>, Vec<_>) = data
Expand Down Expand Up @@ -106,7 +107,7 @@ impl crate::Component for Color {
where
Self: Sized,
{
use crate::{Component as _, Datatype as _};
use crate::Loggable as _;
use ::arrow2::{array::*, datatypes::*};
Ok(data
.as_any()
Expand All @@ -123,3 +124,5 @@ impl crate::Component for Color {
.collect::<crate::DeserializationResult<Vec<Option<_>>>>()?)
}
}

impl crate::Component for Color {}
11 changes: 7 additions & 4 deletions crates/re_types/src/components/draw_order.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ impl<'a> From<&'a DrawOrder> for ::std::borrow::Cow<'a, DrawOrder> {
}
}

impl crate::Component for DrawOrder {
impl crate::Loggable for DrawOrder {
type Name = crate::ComponentName;
#[inline]
fn name() -> crate::ComponentName {
fn name() -> Self::Name {
crate::ComponentName::Borrowed("rerun.draw_order")
}

Expand All @@ -58,7 +59,7 @@ impl crate::Component for DrawOrder {
where
Self: Clone + 'a,
{
use crate::{Component as _, Datatype as _};
use crate::Loggable as _;
use ::arrow2::{array::*, datatypes::*};
Ok({
let (somes, data0): (Vec<_>, Vec<_>) = data
Expand Down Expand Up @@ -101,7 +102,7 @@ impl crate::Component for DrawOrder {
where
Self: Sized,
{
use crate::{Component as _, Datatype as _};
use crate::Loggable as _;
use ::arrow2::{array::*, datatypes::*};
Ok(data
.as_any()
Expand All @@ -118,3 +119,5 @@ impl crate::Component for DrawOrder {
.collect::<crate::DeserializationResult<Vec<Option<_>>>>()?)
}
}

impl crate::Component for DrawOrder {}
Loading