All C++ datatypes & components now implement a new Loggable trait#4305
Merged
All C++ datatypes & components now implement a new Loggable trait#4305
Conversation
this moves all serialization related methods off of the respective structs themselves, leading to better auto complete
jleibs
approved these changes
Nov 22, 2023
Member
jleibs
left a comment
There was a problem hiding this comment.
Takes a bit to wrap your head around template-specialization as traits, but I really like the way this works out.
4 tasks
Wumpf
added a commit
that referenced
this pull request
Nov 23, 2023
### What **&** refactor `rerun::Loggable` to be only producing an the `arrow::Array`. This further aligns Rust and C++ apis which can be best seen in the new example which looks very similar to its rust counterpart \o/ * Fixes #3139 * Depends on / followup of #4305 `DataCell` took over part of the job that `rerun::Loggable` had so far: type registration and putting together the `DataCell` - `to_data_cell` got renamed to `to_arrow` for this purpose. Everything else after that just clicked into place :). Did a few manual runs of the log benchmark to ensure that this didn't regress anything. ### Checklist * [x] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) * [x] I've included a screenshot or gif (if applicable) * [x] I have tested [demo.rerun.io](https://demo.rerun.io/pr/4309) (if applicable) * [x] The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG - [PR Build Summary](https://build.rerun.io/pr/4309) - [Docs preview](https://rerun.io/preview/c5f807af263a1a02a734a499bcd22754dc0646ea/docs) <!--DOCS-PREVIEW--> - [Examples preview](https://rerun.io/preview/c5f807af263a1a02a734a499bcd22754dc0646ea/examples) <!--EXAMPLES-PREVIEW--> - [Recent benchmark results](https://build.rerun.io/graphs/crates.html) - [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
This moves all serialization related methods off of the respective structs themselves, leading to better auto complete.
AsComponents.The default implementations of
AsComponentsnow all require input types to implement this new trait - before they just required the to_data_cell method to be there (that's still the case, but now with an indirection ;))This makes our interface cleaner and paves the way to a good fix for:
(there's a few details still missing for this to allow custom types without dragging in arrow headers, but one thing at a time!)
Checklist