Skip to content

Explicitly mark fields which may be null#55

Merged
Lokathor merged 3 commits intorust-windowing:masterfrom
msiglreith:nonnull
Jan 13, 2021
Merged

Explicitly mark fields which may be null#55
Lokathor merged 3 commits intorust-windowing:masterfrom
msiglreith:nonnull

Conversation

@msiglreith
Copy link
Copy Markdown
Member

  • Encode nullable fields of the handle types in the typesystem (Option<NonNull<_>>). The current change is not exhaustive as I'm not familiar with some platforms (e.g Web)
  • Adjust docs to allow platform cases where the handles may need to be invalidated over time or further gated by platform specifics like winit/android.

Fixes #54

Copy link
Copy Markdown
Contributor

@Lokathor Lokathor left a comment

Choose a reason for hiding this comment

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

Windows HWND values are just *mut c_void, so they can be null. That's generally the "invalid handle" value, and all your OS calls will generally fail and such, but it's a legal bit pattern.

Other than that this seems good.

@Lokathor
Copy link
Copy Markdown
Contributor

Looks good. All set on your end @msiglreith ?

@msiglreith
Copy link
Copy Markdown
Member Author

fine for me 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Android interactions

2 participants