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

arrow2-convert migration 4: support serde-based types in codegen #3902

Merged
merged 9 commits into from
Oct 19, 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 Cargo.lock

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

3 changes: 3 additions & 0 deletions crates/re_types/definitions/rerun/blueprint.fbs
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
include "./blueprint/auto_space_views.fbs";
include "./blueprint/panel_view.fbs";
include "./blueprint/space_view_component.fbs";
include "./blueprint/space_view_maximized.fbs";
include "./blueprint/viewport_layout.fbs";
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
include "arrow/attributes.fbs";
include "python/attributes.fbs";
include "rust/attributes.fbs";

include "rerun/datatypes.fbs";
include "rerun/attributes.fbs";

namespace rerun.blueprint;

// ---

/// A view of a space.
///
/// Unstable. Used for the ongoing blueprint experimentations.
table SpaceViewComponent (
"attr.rust.derive_only": "Clone",
"attr.rust.override_crate": "re_viewport"
) {
space_view: [ubyte] (order: 100, "attr.rust.serde_type": "crate::SpaceViewBlueprint");
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
include "arrow/attributes.fbs";
include "python/attributes.fbs";
include "rust/attributes.fbs";

include "rerun/datatypes.fbs";
include "rerun/attributes.fbs";

namespace rerun.blueprint;

// ---

/// Whether a space view is maximized.
///
/// Unstable. Used for the ongoing blueprint experimentations.
table SpaceViewMaximized (
"attr.arrow.transparent",
"attr.rust.derive": "Copy, Default, PartialEq, Eq",
"attr.rust.override_crate": "re_viewport",
"attr.rust.repr": "transparent",
"attr.rust.tuple_struct"
) {
id: [ubyte] (order: 100, nullable, "attr.rust.serde_type": "re_viewer_context::SpaceViewId");
}

27 changes: 27 additions & 0 deletions crates/re_types/definitions/rerun/blueprint/viewport_layout.fbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
include "arrow/attributes.fbs";
include "python/attributes.fbs";
include "rust/attributes.fbs";

include "rerun/datatypes.fbs";
include "rerun/attributes.fbs";

namespace rerun.blueprint;

// ---

/// A view of a space.
///
/// Unstable. Used for the ongoing blueprint experimentations.
table ViewportLayout (
"attr.rust.derive": "PartialEq",
"attr.rust.override_crate": "re_viewport"
) {
/// space_view_keys
space_view_keys: [ubyte] (order: 100, "attr.rust.serde_type": "std::collections::BTreeSet<re_viewer_context::SpaceViewId>");

/// tree
tree: [ubyte] (order: 101, "attr.rust.serde_type": "egui_tiles::Tree<re_viewer_context::SpaceViewId>");

/// auto_layout
auto_layout: bool (order: 102);
}
8 changes: 8 additions & 0 deletions crates/re_types/definitions/rust/attributes.fbs
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,11 @@ attribute "attr.rust.new_pub_crate";
/// an object of kind `Blueprint` with `attr.rust.override_crate=re_viewport`, the final
/// object will be generated in `crates/re_viewport/src/blueprint`.
attribute "attr.rust.override_crate";

/// Specify on an object field of type `[ubyte]` in order to (de)serialize using a pre-existing
/// `serde` implementation.
///
/// Everything else works the same, include how module names are derived: e.g. if you define
/// an object of kind `Blueprint` with `attr.rust.override_crate=re_viewport`, the final
/// object will be generated in `crates/re_viewport/src/blueprint`.
attribute "attr.rust.serde_type";
35 changes: 20 additions & 15 deletions crates/re_types/src/archetypes/annotation_context.rs

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

Loading