-
-
Notifications
You must be signed in to change notification settings - Fork 176
[WIP] uefi-raw: move types to new net module, improve convenience #1699
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
base: main
Are you sure you want to change the base?
Conversation
2b8f102
to
85838ce
Compare
For the record. Starting Friday, I'll be on vacation until July 30th. My plan is to program-detox for the whole period 😀 Restarting the work afterwards |
I'm unsure how I could fix the rustdoc error best. I want the documentation of the However: making the module public allows to import the same types from |
What if we removed the module doc and instead added this information to the individual types? The module doc is basically saying "you can convert between /// An IPv4 internet protocol address.
///
/// This type can be converted to and from [`core::net::Ipv4Addr`] using the [`From`] trait.
|
c2d44b0
to
24d5443
Compare
Yeah, good idea, why not :) What do you think about the latest state? |
411d16e
to
f2b5198
Compare
Generally looks good, but I haven't reviewed the details yet. Could you open a PR that just does the copy-paste move of stuff to a new module first? That should be very quick to review and merge, and then it won't get mixed in with the other changes. (I realize it's already broken down that way by commit, but there are still a lot of changes in commit 870aced that I would like to review more thoroughly, and it'll be easier for me if the module-move has already been merged.) |
We have enough network-related types to justify a dedicated module: - IpAddress - Ipv4Address - Ipv6Address - MacAddress
This aligns the API with the core::net API.
This will help in the following to better distinct between all the types from core::net (Std prefix) and EFI (no prefix).
This prepares my vision for #1575, a split-out from #1645, and a change to uefi-raw in the sense that some types now have slightly more higher-level logic. This "higher-level" logic is still low-level enough that I think it is perfectly fine to keep it. It will also not hinder Rust-based UEFI implementations.
TL;DR: My vision is that in
uefi
we only exposecore::net::{IpAddr, Ipv4Addr, Ipv6Addr}
and protocol implementations can useFrom/Into
to do all the necessary work under the hood.Let me know what you think!
List of Changes
refactored theIpAddress
type to be more convenient, more memory-safe, and pleasant to useFrom
implementationsSteps to Undraft
Checklist