-
-
Notifications
You must be signed in to change notification settings - Fork 176
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? |
2ce45f0
to
411d16e
Compare
We have enough network-related types to justify a dedicated module: - IpAddress - Ipv4Address - Ipv6Address - MacAddress
This streamlines the integration with core::net types but also the general usage of uefi_raw::net types.
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
implementationsChecklist