Skip to content

Use NonNull in struct Event, similar to struct Handle #477

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

Closed
nicholasbishop opened this issue Jul 31, 2022 · 0 comments
Closed

Use NonNull in struct Event, similar to struct Handle #477

nicholasbishop opened this issue Jul 31, 2022 · 0 comments

Comments

@nicholasbishop
Copy link
Member

In #309, the Handle type was changed from containing just a raw pointer to NonNull<c_void>, which has the nice advantage that you can then use Option<Handle> when you want a nullable Handle, and this is FFI-safe.

As was mentioned in #309 (comment), it would make sense to do this for the Event type too -- there are times when it needs to be nullable such as the token structures in BlockIO2 and DiskIO2.

Relevant code: https://github.com/rust-osdev/uefi-rs/blob/main/src/data_types/mod.rs#L42

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

No branches or pull requests

2 participants