-
Notifications
You must be signed in to change notification settings - Fork 59
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
[Idea] Never panic when calling extension methods #129
Comments
What's the basis for this conclusion? In general, extension functions that are not implemented by a runtime cannot return any particular value because they do not exist at all. |
All functions belonging to extensions have this
So it seems that extensions functions could return this value if the platform specific loader already have them defined statically but the associated extension is not enabled for a particular instance. So, even if in openxrs all extension functions are loaded dynamically, I think it would be semantically correct and equivalent to return |
That's documenting the behavior of |
I'm working on adding new high level wrappers for some extensions. Some existing wrappers (like |
Currently when some extensions are disabled and you try to call some associated methods, for example
request_display_refresh_rate
, it would lead to a crash because there is oneexpect()
call:openxrs/openxr/src/display_refresh_rate.rs
Line 66 in e5fe416
In such cases it seems OpenXR would return
XR_ERROR_FUNCTION_UNSUPPORTED
. We could also return that error code. In this way it would be simpler to just do.ok()
for some calls likerequest_display_refresh_rate
which don't require any special handling when it fails.The text was updated successfully, but these errors were encountered: