Skip to content

Commit

Permalink
impl AsComponents for all ObjectKind::Component
Browse files Browse the repository at this point in the history
  • Loading branch information
oxkitsune committed Oct 15, 2024
1 parent 5325fd8 commit c59a502
Show file tree
Hide file tree
Showing 119 changed files with 842 additions and 0 deletions.
16 changes: 16 additions & 0 deletions crates/build/re_types_builder/src/codegen/rust/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -989,6 +989,20 @@ fn quote_trait_impls_for_datatype_or_component(
}
};

let quoted_as_components_impl = if matches!(kind, ObjectKind::Component) {
quote! {
impl ::re_types_core::AsComponents for #name {
fn as_component_batches(&self) -> Vec<MaybeOwnedComponentBatch<'_>> {
re_tracing::profile_function!();

vec![(self as &dyn ComponentBatch).into()]
}
}
}
} else {
quote!()
};

quote! {
::re_types_core::macros::impl_into_cow!(#name);

Expand Down Expand Up @@ -1016,6 +1030,8 @@ fn quote_trait_impls_for_datatype_or_component(

#quoted_from_arrow
}

#quoted_as_components_impl
}
}

Expand Down
7 changes: 7 additions & 0 deletions crates/store/re_types/src/blueprint/components/active_tab.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions crates/store/re_types/src/blueprint/components/corner2d.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions crates/store/re_types/src/blueprint/components/interactive.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions crates/store/re_types/src/blueprint/components/panel_state.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions crates/store/re_types/src/blueprint/components/row_share.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions crates/store/re_types/src/blueprint/components/view_fit.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions crates/store/re_types/src/blueprint/components/visible.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions crates/store/re_types/src/components/aggregation_policy.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions crates/store/re_types/src/components/albedo_factor.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions crates/store/re_types/src/components/annotation_context.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions crates/store/re_types/src/components/axis_length.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions crates/store/re_types/src/components/blob.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions crates/store/re_types/src/components/class_id.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions crates/store/re_types/src/components/color.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions crates/store/re_types/src/components/colormap.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions crates/store/re_types/src/components/depth_meter.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c59a502

Please sign in to comment.