-
-
Notifications
You must be signed in to change notification settings - Fork 186
uefi: significantly improve ergonomics of Handle (device path and component2 protocols) #1858
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
Open
phip1611
wants to merge
5
commits into
main
Choose a base branch
from
handle-convenience
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+223
−71
Conversation
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
8dd6b43 to
b9c1651
Compare
312e542 to
a3c3e1e
Compare
24fe1fb to
7661a74
Compare
Member
Author
|
@nicholasbishop Every time I split things into smaller PRs and clean up the commit history, they somehow grow again 😀 Let me know if this size works for you. |
This is a pre-requisite for the next commit that implements Display. Display comes with a to_string() method already.
For device paths, it is very convenient to use the DevicePathToText protocol to visualize/print the device path. By providing a convenient Display impl, we improve the ergonomics of device paths significantly and reducing boilerplate.
Clean up the mess and follow our convention: - pub mod - mod - pub use - use
…_path() In practice, UEFI applications frequently need to extract additional metadata from handles for logging, debugging, and user-facing selection. The Device Path and Component Name 2 protocols provide helpful information, but accessing them repeatedly requires non-trivial boilerplate. This change introduces convenience helpers on Handle to streamline common queries and improve ergonomics when working with these protocols.
7661a74 to
58bbda3
Compare
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.
This PR prepares and implements a significant simplification of handling typical tasks with handles: printing a device path and using the component2 protocol.
addboot::open_protocol_[exclusive]if_exists()helpers (eventually replacing the base methods which we could deprecate)Handle::device_path()andHandle::component_name()This improves the convenience and ergonomics in every Rust uefi code base I've seen so far at work and in private projects.
Checklist