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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forward Rust (de-)serialization of transparent datatypes #6793

Merged
merged 6 commits into from
Jul 8, 2024

Conversation

Wumpf
Copy link
Member

@Wumpf Wumpf commented Jul 5, 2024

What

Remove lots of redundant serialization code by forwarding transparent components to its datatypes:

  • forward from_arrow_opt for fully transparent types
  • forward from_arrow for fully transparent types
    • this requires us generating it for datatypes!
    • the forwarding uses bytemuck when possible. Should be possible in more places, but the constraints are complicated so this isn't fully automated and depends on types being manually marked as bytemuck::Pod
      * would be really nice though if we could automate that. Almost everything we're dealing with should be pod 馃
  • forward to_arrow_opt for fully transparent types
  • forward arrow_datatype for fully transparent types

@ reviewer: There's only two non-generated files:

Checklist

  • I have read and agree to Contributor Guide and the Code of Conduct
  • I've included a screenshot or gif (if applicable)
  • I have tested the web demo (if applicable):
  • The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG
  • If applicable, add a new check to the release checklist!

To run all checks from main, comment on the PR with @rerun-bot full-check.

@Wumpf Wumpf force-pushed the andreas/rust-codegen-forwarding branch from e3cca8a to 4d2714a Compare July 8, 2024 13:48
@Wumpf Wumpf added 馃殰 refactor Change the code, not the functionality include in changelog labels Jul 8, 2024
@Wumpf Wumpf marked this pull request as ready for review July 8, 2024 13:58
@emilk emilk self-requested a review July 8, 2024 14:18
Copy link
Member

@emilk emilk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

crates/re_types_builder/src/codegen/rust/api.rs Outdated Show resolved Hide resolved
crates/re_types_builder/src/codegen/rust/api.rs Outdated Show resolved Hide resolved
crates/re_types_builder/src/codegen/rust/api.rs Outdated Show resolved Hide resolved
crates/re_types_builder/src/codegen/rust/api.rs Outdated Show resolved Hide resolved
crates/re_types_builder/src/codegen/rust/api.rs Outdated Show resolved Hide resolved
@Wumpf
Copy link
Member Author

Wumpf commented Jul 8, 2024

less lambdas, neat suggestions! :)

@Wumpf Wumpf merged commit 8e437bd into main Jul 8, 2024
33 of 34 checks passed
@Wumpf Wumpf deleted the andreas/rust-codegen-forwarding branch July 8, 2024 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
include in changelog 馃殰 refactor Change the code, not the functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants