Convert T::out(...) to trait XrOutType::base_out(...)
#110
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.
For my project, I found it useful to be able to reason about whether certain types were: 1) an XR type, 2) and XR output type, or 3) an XR input type.
I wanted to be able to call
T::out(...)on any such type. Although openxrs providedT::out(...)it did not provide any way to group types which might be an OpenXR out type.This PR converts
outto a trait (which also makes more semantic sense to me -- it's same behavior that many distinct structs share), which would let one, for example, create a function that takes in anything that can be populated bybase_out. I personally found this useful when writing a different wrapper around the Result type.A benefit of this approach is that it reduces the amount of code generated, though I'm not sure if that has measurable effects on e.g., compile time.